在本地计算机中,包含了一个Update.xml,当程序启动的时候,会加载这个XML,然后回加载IIS服务器上的version.xml,然后把它们比较,如果本地的xml中指定的版本比服务器上的版本底的话,就从服务器上自动下载更新的文件,然后启动它。。这个是升级程序的类
using System;
using System.Xml;
namespace InfoLibraryManage
{
/// <summary>
/// Update 用于程序升级信息库的管理
/// </summary>
public class Update
{
private string strXMLFile = "";
private string strServerAddress = "";
private string ListFileName = "";
private string DownloadFileName = "";
private string strListFile = "";
private string strDownloadFile = "";
private string AppStartPath = "";
private string RemoteListFile = "";
private string RemoteDownFile = "";
private string RemoteAddress = "";
int nLocalMainVersion = -1;
int nLocalSecondVersion = -1;
int nRemoteMainVersion

本文介绍了一个使用C#编写的程序升级类,通过比较本地Update.xml与服务器version.xml的版本信息,判断是否需要更新。当远程版本高于本地时,程序将从服务器下载更新文件并启动更新过程。
最低0.47元/天 解锁文章
901

被折叠的 条评论
为什么被折叠?



