微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

c# – 如何确定退出代码的来源?

Process p = new Process();
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.CreateNowindow = true;
p.StartInfo.FileName = @"PsExec.exe";
p.StartInfo.Arguments = @"\\10.10.1.127 -accepteula -i -u administrator -p 1 -n 10 c:\myapp.exe";
p.Start();

如何确定p.ExitCode是来自PsExec还是myapp.exe的代码

解决方法

使用非零错误代码的组合和解析PsExec的最后几行输出.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐