我没有源代码的程序正在执行第三方 EXE 文件。我想找出它发送到 EXE 文件的参数(即 thirdparty.exe -c "foo"-d "bar")。我知道初始程序是用 Visual Basic 编写的。
有没有我可以运行的工具来监视执行调用并拦截参数?
如有任何帮助,我们将不胜感激。
最佳答案
要以编程方式获取它,请使用 WMI:
SelectQuery query = new SelectQuery("select CommandLine from Win32_Process where Name='thirdparty.exe'");
ManagementObjectSearcher searcher = new ManagementObjectSearcher(query);
foreach (var process in searcher.Get())
{
Debug.WriteLine(process.GetPropertyValue("CommandLine"));
}
如果您只想查看命令行,可以使用 Process Explorer 来实现.
关于windows - 跟踪在 VB.net 应用程序中调用的外部 .EXE 的参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2249136/