环境.退出挂起

发布于 2024-11-28 16:20:44 字数 82 浏览 4 评论 0原文

在 C# 中,什么会导致 Environment.Exit(1) 挂起?我从命令行调用我的程序,它最终在空白行上出现一个闪烁的光标。打字没有任何作用。

In C#, what would cause Environment.Exit(1) to hang? I'm calling my program from the command line, and it ends up with a blinking cursor on a blank line. Typing doesn't do anything.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

尬尬 2024-12-05 16:20:44

Environment.Exit 不会挂起应用程序,相反,它立即终止它:

终止此进程并向底层操作系统提供指定的退出代码。

还有其他原因导致您的控制台应用程序挂起,但如果您不添加一些代码,我们无法猜测问题是什么。

The Environment.Exit doesn't hang the application, on the contrary, it terminates it instantly:

Terminates this process and gives the underlying operating system the specified exit code.

There is something else causing your Console application to hang, but we can't guess what is the issue without you adding some code.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文