C# WINFORM 自动更新

flurrying 2009-03-16 10:03:12
C# WINFORM 自动更新使用的XML文件

这个XML文件怎么设置呀!


[Description("应用程序文件URL")]
public string AppFileURL
{
get
{
return this._AppFileURL;
}
set
{
this._AppFileURL = value;
}
}

[DefaultValue(""), Description("应用程序路径。")]
public string ApplicationPath
{
get
{
return this._applicationpath;
}
set
{
this._applicationpath = value;
}
}

[Description("可用版本")]
public string AvailableVersion
{
get
{
return this._AvailableVersion;
}
set
{
this._AvailableVersion = value;
}
}

[Description("变更日志URL")]
public string ChangeLogURL
{
get
{
return this._ChangeLogURL;
}
set
{
this._ChangeLogURL = value;
}
}

[DefaultValue("http://localhost/UpdateConfig.xml"), Description("配置文件URL。(例如:http://localhost/UpdateConfig.xml)"), Category("自动更新配置")]
public string ConfigURL
{
get
{
return this._ConfigURL;
}
set
{
this._ConfigURL = value;
}
}

[Description("指定应用程序的当前版本"), Browsable(false)]
public Version CurrentAppVersion
{
get
{
return Assembly.LoadFile(this.ApplicationPath + @"\" + this.EntryPoint).GetName().Version;
}
}

[Description("指定应用程序的入口点")]
public string EntryPoint
{
get
{
return this._entrypoint;
}
set
{
this._entrypoint = value;
}
}

[Description("更新说明")]
public string LatestChanges
{
get
{
return this._LatestChanges;
}
set
{
this._LatestChanges = value;
}
}

[Browsable(false)]
public string LatestConfigChanges
{
get
{
return this.LatestChanges;
}
}

[Description("最新的配置文件版本"), Browsable(false)]
public Version LatestConfigVersion
{
get
{
return new Version(this.AvailableVersion);
}
}

[DefaultValue(""), Description("服务器端所需的登录名"), Category("自动更新配置")]
public string LoginUserName
{
get
{
return this._LoginUserName;
}
set
{
this._LoginUserName = value;
}
}

[Description("服务器端所需的登录密码"), Category("自动更新配置"), DefaultValue("")]
public string LoginUserPass
{
get
{
return this._LoginUserPass;
}
set
{
this._LoginUserPass = value;
}
}

[Description("是否有可用的新版本"), Browsable(false)]
public bool NewVersionAvailable
{
get
{
return (this.LatestConfigVersion > this.CurrentAppVersion);
}
}

[Description("选中的产品信息")]
public DataRow ProductInformation
{
get
{
return this.mProductInformation;
}
set
{
this.mProductInformation = value;
}
}

[Description("产品列表")]
public DataTable ProductList
{
get
{
return this.mProductList;
}
set
{
this.mProductList = value;
}
}

[Description("产品列表URL"), DefaultValue("http://www.flurrying.cn/ProductList.xml")]
public string ProductListURL
{
get
{
return this.m_productListURL;
}
set
{
this.m_productListURL = value;
}
}

[Description("是否启动代理"), Category("自动更新配置"), DefaultValue(false)]
public bool ProxyEnabled
{
get
{
return this._ProxyEnabled;
}
set
{
this._ProxyEnabled = value;
}
}

[DefaultValue(false), Description("代理服务器是否需要进行用户校验")]
public bool ProxyEnableUserPassword
{
get
{
return this._proxyuserenable;
}
set
{
this._proxyuserenable = value;
}
}

[Description("代理服务器密码")]
public string ProxyPassword
{
get
{
return this._ProxyPwd;
}
set
{
this._ProxyPwd = value;
}
}

[DefaultValue("http://myproxy.com:8080/"), Description("代理服务器URL(例如:http://myproxy.com:8080)"), Category("自动更新配置")]
public string ProxyURL
{
get
{
return this._ProxyURL;
}
set
{
this._ProxyURL = value;
}
}

[Description("代理服务器用户名")]
public string ProxyUser
{
get
{
return this._ProxyUser;
}
set
{
this._ProxyUser = value;
}
}

[Description("临时路径")]
public string TempPath
{
get
{
return this._temppath;
}
set
{
this._temppath = value;
}
}

[DefaultValue("update"), Description("ZIP文件名")]
public string ZipFileName
{
get
{
return this._zipfilename;
}
set
{
this._zipfilename = value;
}
}
...全文
1439 15 打赏 收藏 转发到动态 举报
写回复
用AI写文章
15 条回复
切换为时间正序
请发表友善的回复…
发表回复
pengrui0719 2010-04-18
  • 打赏
  • 举报
回复
mark
zhaoyunrui 2010-03-18
  • 打赏
  • 举报
回复
时刻关注.我也想做这个
ziyi08082010 2010-01-20
  • 打赏
  • 举报
回复
mark
jdz 2010-01-20
  • 打赏
  • 举报
回复
DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
paladian1 2010-01-02
  • 打赏
  • 举报
回复
mark
flurrying 2009-03-16
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 zhoufoxcn 的回复:]
做几点建议:
一、配置信息可以使用.config文件,因为提供了相关的类以便修改,这样就不用直接操作XML了。
二、自动更新的话,可以在后台使用一个线程去操作(如果配置文件更新很快的话),如果不是更新很快的话可以在程序每次启动的时候检测一下是否有最新版本的配置文件就可以了(可以在配置文件中添加一个节点表示当前版本号)。
[/Quote]

谢谢!

谢谢您的回复!

建议上一看就知道是专家了,可是我刚学C# 时间不长,有思路不会写!


fly_to_sky 2009-03-16
  • 打赏
  • 举报
回复
同意楼上大哥的
周公 2009-03-16
  • 打赏
  • 举报
回复
做几点建议:
一、配置信息可以使用.config文件,因为提供了相关的类以便修改,这样就不用直接操作XML了。
二、自动更新的话,可以在后台使用一个线程去操作(如果配置文件更新很快的话),如果不是更新很快的话可以在程序每次启动的时候检测一下是否有最新版本的配置文件就可以了(可以在配置文件中添加一个节点表示当前版本号)。
ztenv 2009-03-16
  • 打赏
  • 举报
回复
大哥,你要干什么?
flurrying 2009-03-16
  • 打赏
  • 举报
回复
有文件源码
http://d.download.csdn.net/down/1111382/flurrying

只缺XML文件!


大家帮看看!
whowhen21 2009-03-16
  • 打赏
  • 举报
回复
帮顶一下哦。
学习

111,126

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Creator Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧