Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在为我的一个应用程序添加安全性。我希望在启用时启动配置了 .rdp(远程桌面)的 C:\Windows\System32\mstsc.exe c:\thinclient\pekts00.rdp。它将继续运行以检查 mstsc.exe 是否正在运行,如果没有,它将注销窗口或启动它。
尝试如下...它会帮助你...
System.Diagnostics.Process[] pname = System.Diagnostics.Process.GetProcessesByName("mstsc"); if (pname.Length == 0) System.Diagnostics.Process.Start(Environment.GetEnvironmentVariable("windir") + @"\system32\mstsc.exe");