应为工作需要花了两个小时写了个局域网更新程序 ,简是简单了点 ,但是感觉还挺好用 ,和大家分享下 !
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Xml;
using System.Threading;
using System.Windows.Forms;
namespace AutoUpdateSystem
{
public class LogicClass
{
public LogicClass()
{
}
string AutoUpdateFile = "AutoUpdateFile.xml";
DateTime dt;
/// <summary>
/// 是否重起应用程序
/// </summary>
public bool ReStart
{
get
{
string res=ReadXmlInfo(AutoUpdateFile, "ReStart", "Allow");
if (res.ToLower() == "yes")
{
return true;
}
else
{
return false;
}
}
}
/// <summary>
/// 启动的应用程序名
/// </summary>
public string AppName
{
get
{
return ReadXmlInfo(AutoUpdateFile, "AppName", "Name");
}
}
/// <summary>
/// 是否启用强制更新
/// </summary>
public bool ForcedUpdating
{
get
{
string res = ReadXmlInfo(AutoUpdateFile, "forcedupdating", "Allow");
if (res.ToLower() == "yes")
{
return true;
}
else
{