Update.cs
2.0 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
//----------------------------------------------------------------
// Copyright (C) 2000-2003 Shangxin Corporation
// All rights reserved.
using System;
using System.Data;
using LiveUpdate.UpdateSvc;
namespace LiveUpdate
{
/// <summary>
/// UpdateSystem 的摘要说明。
/// </summary>
public class UpdateSystem
{
protected System.Net.CookieContainer Cookies;
private string WebServiceUrl = "";
public UpdateSystem()
{
}
public UpdateSystem(string Url)
{
WebServiceUrl = Url;
}
private UpdateSvc.UpdateSvc m_wsUpdateSvc;
private UpdateSvc.UpdateSvc NewUpdateSvc()
{
if (m_wsUpdateSvc == null)
{
m_wsUpdateSvc = new UpdateSvc.UpdateSvc();
if (WebServiceUrl != "")
{
m_wsUpdateSvc.Url = WebServiceUrl;
}
SetCookiesUriHaveCookie(m_wsUpdateSvc);
}
return m_wsUpdateSvc;
}
protected void SetCookiesUriHaveCookie(System.Web.Services.Protocols.SoapHttpClientProtocol ws)
{
if (Cookies == null)
Cookies = new System.Net.CookieContainer();
ws.CookieContainer = Cookies;
}
/// <summary>
/// 获得最新客户端的版本信息
/// </summary>
/// <returns></returns>
public string GetClientVersion()
{
return NewUpdateSvc().GetClientVersion();
}
public DataSet GetClientFileList()
{
return NewUpdateSvc().GetClientFileList();
}
public byte[] GetClientFile(string FileName)
{
return NewUpdateSvc().GetClientFile(FileName);
}
public string GetUpdateUrl()
{
UpdateSvc.UpdateSvc usws = new UpdateSvc.UpdateSvc();
if (this.WebServiceUrl != null || this.WebServiceUrl != "")
{
usws.Url = this.WebServiceUrl;
}
return usws.Url;
}
}
}