c# 软件自动升级 程序自我关闭自己后重启

时间:2014-05-08 23:02:31   收藏:0   阅读:676

 

 

bubuko.com,布布扣
               //指定一个文件名,写入脚本
string filename = Path.Combine(path,"killmyself.bat"); using (StreamWriter bat = new StreamWriter(filename, false, Encoding.GetEncoding("GB2312"))) { //删除指定程序,复制指定程序到指定路径 bat.WriteLine(string.Format(@" @echo off del "+ifexe+@" copy /y """+path+@"temp\fileServer\"+ifexe+@""" """+path+@""" """+path+ifexe+ @""" del %0 ")); // del %0 } ProcessStartInfo info = new ProcessStartInfo(filename); info.WindowStyle = ProcessWindowStyle.Hidden; Process.Start(info); Environment.Exit(0);
bubuko.com,布布扣

 

c# 软件自动升级 程序自我关闭自己后重启,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!