using system;
using system.collections.generic;
using system.linq;
using system.text;
using autoupgrade.models;
using system.xml.linq;
using system.net;
using system.windows.forms;
using system.configuration;
using system.io;
using system.diagnostics;
namespace autoupgrade.bl
return _instance;
}public xmlfilehandle()
#region 檢查更新檔案是否有新的補丁
/// /// 檢查更新檔案是否有新的補丁
///
///
public bool checkupdatefile()
return false;
}private datetime getlocalupdatefilereleasetime()
private datetime getinterupdatefilereleasetime()
private datetime getupdatefilereleasetime(string strpath)
catch (exception ex)
return datetime.minvalue;
}#endregion
#region 讀取更新檔案到資料集合list中
///
private listreadinternetupdatelist()
/// /// 獲取local檔案列表
///
///
private listreadlocalupdatelist()
private listreadupdatelist(string path)
catch (webexception ex)
return null;
}private listreadrootxml(xelement folderelement)
model.filelist = readfilexml(folderelement);
model.childfolder = readfolderxml(folderelement);
list.add(model);
return list;
}catch (exception ex)
return null;
}private listreadfilexml(xelement folderelement)
list.add(model);
}return list;
}catch (exception ex)
return null;
}private listreadfolderxml(xelement folderelement)
model.filelist = readfilexml(item);
model.childfolder=readfolderxml(item);
list.add(model);
}return list;
}catch (exception ex)
return null;
}#endregion
public listgetanalysisupdatefilebymodifytime()
private void getupdatefolderlist(folderinfomodel model,listupmodel)
if (model.childfolder != null && model.childfolder.count > 0)}}
private listgetupdatefilelist(folderinfomodel model)
);return list.tolist();
}#region 檢查資料集合與本地檔案比對,返回具體更新列表
public updatafilemodel getlocalupdatefileall()
return null;
}private void loadlocalupdatefileall()
private void checklocaldir(folderinfomodel folder,listlist)
checklocalfile(item, list);
checklocaldir(item, list);}}
private void checklocalfile(folderinfomodel folder, listlist)
;if (file.exists(filepath))}}
else}}
#endregion
}}
using system;
using system.collections.generic;
using system.diagnostics;
using system.linq;
using system.text;
using system.threading.tasks;
using system.xml.linq;
namespace autoupgrade.models
set}
public string filepath
public string relativepath
public string fileext
public long filesize
public datetime createtime
public datetime modifytime
private string _versin = string.empty;
public string version
set}
private int _productmajorpart =0;
public int productmajorpart
}public bool isfilter
public folderinfomodel parentfolder
}}
using system;
using system.collections.generic;
using system.linq;
using system.text;
using system.threading.tasks;
using system.xml.linq;
namespace autoupgrade.models
public string folderpath
public folderinfomodel parentfolder
public listchildfolder
public listfilelist
public datetime createtime
public bool isfilter
public xelement getmodelxml()
}}
using system;
using system.collections.generic;
using system.linq;
using system.text;
namespace autoupgrade.models
public string localpath
public string urlpath
public long filesize
public datetime modifytime
public string version
public bool equals(updatafilemodel other)
public override int gethashcode()
}}
C 軟體自動更新程式 六
using system using system.collections.generic using system.globalization using system.linq using system.net using system.text using system.windows.for...
C 編寫自動更新程式
現在但凡是乙個程式都有相應的公升級程式,如果你的程式沒有相應的公升級程式,那麼你就需要留意了。你的使用者很可能丟失!網上關於自動公升級的例子也有很多,前幾天乙個朋友很苦惱的跟我說它的客戶在逐漸減少 據他所說,他都客戶因為他的程式公升級很麻煩,所以很多人放棄了使用它的軟體 問我說怎麼辦?其實他也知道該...
exe程式自動更新
exe檔案自動更新 思路邏輯 1.在客戶端 使用者 存在某exe檔案 及乙個.ini檔案 2.在公網伺服器某路徑下存放該exe檔案及.ini檔案 3.在客戶端執行exe檔案,取得本地的.ini中記錄的版本號 並取得公網伺服器該程式路徑下的.ini記錄的版本號 對比4.若有更新則進行程式更新操作 指令...