gpt4 book ai didi

vb.net - 错误 "Source: system process has exited, so the requested information is not available"

转载 作者:行者123 更新时间:2023-12-05 06:46:35 28 4
gpt4 key购买 nike

它在我的 PC 上工作,但当我放入另一台机器时,我收到错误消息“来源:系统进程已退出,因此请求的信息不可用”并且 exe 没有出现。有没有有经验的兄弟帮忙看看赞赏!

        p = New Process
With p
.EnableRaisingEvents = True
.StartInfo.FileName = Application.StartupPath & "\EXE\CDMObjectSelection\CDMObjectSelection.exe"
.StartInfo.Arguments = strArgs
.StartInfo.ErrorDialog = True
.StartInfo.WindowStyle = ProcessWindowStyle.Normal
.StartInfo.UseShellExecute = True
.Start()
End With

p.WaitForInputIdle()

While (ginthwnd = IntPtr.Zero)
System.Threading.Thread.Sleep(100)
p.Refresh()
ginthwnd = p.MainWindowHandle
End While

最佳答案

如果您在调试器中跟踪此代码或将其包装在 try/catch block 中,您可能会发现异常发生在 p.WaitForInputIdle()。作为MSDN states :当进程已经退出时抛出此异常。尝试将调用包装在 try/catch 中并处理 InvalidOperationException

MSDN 还说“如果进程没有消息循环,WaitForInputIdle 会抛出 InvalidOperationException”。确保您调用的进程有一个消息循环。

See this answer了解如何正确关闭您的进程。

关于vb.net - 错误 "Source: system process has exited, so the requested information is not available",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14576848/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com