System.Diagnostics.Process p = new Process();
p.StartInfo.UseShellExecute = true;
p.StartInfo.FileName = @"C:\Windows\System32\calc.exe";
p.Start();
Write("C:\\test.log", Getdate() + "程序未启动!");
以上语名在窗体应用程序中好使,但在服务中就无效果。
p.StartInfo.UseShellExecute = true;
p.StartInfo.FileName = @"C:\Windows\System32\calc.exe";
p.Start();
Write("C:\\test.log", Getdate() + "程序未启动!");
以上语名在窗体应用程序中好使,但在服务中就无效果。
除非你注册服务时,要明确指定 允许和窗体交互。