自我更新模块
根据自定义文件进行程序更新 static void Main() { try { System.Net.WebClient download = new System.Net.WebClient(); download.BaseAddress = "ftp://ftp.ftp.com/System/"; download.DownloadFile("upgrade.list", "upgrade.list"); System.IO.StreamReader a = new System.IO.StreamReader("upgrade.list"); bool up = true; string upfile = a.ReadLine(); while (up) { upfile = a.ReadLine(); if (upfile == null) up = false; else { if(upfile.LastIndexOf('\\')>-1) System.IO.Directory.CreateDirectory(upfile.Substring(0, upfile.LastIndexOf('\\'))); download.DownloadFile(upfile, upfile); } } download.Dispose(); MessageBox.Show("升级完毕"); } catch (Exception ex) { MessageBox.Show("升级失败:" + ex.Message); } System.Diagnostics.Process tmpProcess = new System.Diagnostics.Process(); tmpProcess.StartInfo.FileName = Application.StartupPath + "\\myststem.exe"; tmpProcess.Start(); }
- 粉丝: 0
- 资源: 3
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助