码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2014-05-08 23:02:31      阅读:676      评论:0      收藏:0      [点我收藏+]

标签:style   blog   class   code   java   tar   

 

 

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

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

标签:style   blog   class   code   java   tar   

原文地址:http://www.cnblogs.com/pigddyou/p/3716694.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!