Process process = new Process(); process.StartInfo.UserName = 指定用户名; string strPWD = 密码; SecureString password = new SecureString(); foreach (char c in strPWD.ToCharArray()) { password.AppendChar(c); } process.StartInfo.Password = password; process.StartInfo.WorkingDirectory = AppDomain.CurrentDomain.BaseDirectory; process.StartInfo.FileName = "xxx.exe"; process.StartInfo.Arguments = "/run /wu"; process.StartInfo.UseShellExecute = false; process.Start();
c# 指定用户启动 exe
最新推荐文章于 2024-06-19 15:42:58 发布