修改Program.cs文件 using System; using System.Collections.Generic; using System.Linq; using System.Windows.Forms; namespace Test { static class Program { /// <summary> /// 应用程序的主入口点. /// </summary> [STAThread] static void Main(string[] args) { boo…
内容来自:https://codereview.stackexchange.com/questions/20871/single-instance-wpf-application 第一步:添加System.RunTime.Remoting引用 第二步:新建一个类class1.cs(按自己想法命名) using System; using System.Collections; using System.Collections.Generic; using System.ComponentMode…