妙博客

世界上最可怜的人,结构没破位赚一点就跑,结构破位死扛幻想反转

C# 如何实现WinForm程序自重启(重新启动自己)

两种方法:

1.用Application自带的退出方法

Application.Exit();
Application.Restart();


2.多开方法

Thread thtmp = new Thread(new ParameterizedThreadStart((obj)=>
            {
                Process ps = new Process();
                ps.StartInfo.FileName = obj.ToString();
                ps.Start();
            }));
            object appName = Application.ExecutablePath;
            Thread.Sleep(2000);
            thtmp.Start(appName);


«   2026年11月   »
一 二 三 四 五 六 日
1
2345678
9101112131415
16171819202122
23242526272829
30
网站分类
搜索
标签列表
文章归档
网站收藏
友情链接
  • 订阅本站的 RSS 2.0 新闻聚合

Copyright Your 142132.com Rights Reserved. 赣ICP备17010829号-2