HOW TO:重启程序(WinForm)
来源:互联网 发布:花卉产业数据 编辑:程序博客网 时间:2024/06/07 00:10
Author:水如烟
Public Class RestartProgramService
Private Shared gAppLocation As String
Public Shared Sub Run()
AddHandler AppDomain.CurrentDomain.ProcessExit, AddressOf AppDomain_ProcessExit
gAppLocation = Reflection.Assembly.GetEntryAssembly.Location
System.Diagnostics.Process.GetCurrentProcess.CloseMainWindow()
End Sub
Private Shared Sub AppDomain_ProcessExit(ByVal sender As Object, ByVal e As System.EventArgs)
System.Diagnostics.Process.Start(gAppLocation)
End Sub
End Class
Private Shared gAppLocation As String
Public Shared Sub Run()
AddHandler AppDomain.CurrentDomain.ProcessExit, AddressOf AppDomain_ProcessExit
gAppLocation = Reflection.Assembly.GetEntryAssembly.Location
System.Diagnostics.Process.GetCurrentProcess.CloseMainWindow()
End Sub
Private Shared Sub AppDomain_ProcessExit(ByVal sender As Object, ByVal e As System.EventArgs)
System.Diagnostics.Process.Start(gAppLocation)
End Sub
End Class
可怜,我居然不知道已有Application.Restart这玩意儿.
- HOW TO:重启程序(WinForm)
- Winform读写App.config文件以及重启程序
- 重启程序
- 重启程序
- VC++, 重启程序
- 定时重启程序
- 自动重启程序
- Shell 重启程序
- QT重启程序
- Application回收重启程序
- 一个简易的重启程序
- linux 定时重启程序脚本
- C#不重启程序读取appconfig
- 全部捕获异常之后重启程序
- 能定时重启程序,不断循环.重启程序时关闭老程序
- linux下通过脚本实现自动重启程序
- linux下通过脚本实现自动重启程序
- linux下通过脚本实现自动重启程序
- 《程序员》卷首语-呼唤明星
- javascript使用关键字defer
- Detecting Windows NT/2K process execution
- zlib用法简单说明
- 喜欢/爱
- HOW TO:重启程序(WinForm)
- 二层安全威胁攻击防范
- 《The Complete Effect and HLSL Guide》翻译连载(九)
- Jabber学习笔记 之一
- 网站设计常用技巧
- 不爽
- 生命的厚味
- 将excel表格导入数据库
- 同步