在线程中运行进程?

编程入门 行业动态 更新时间:2024-10-28 12:16:19
本文介绍了在线程中运行进程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

是否有可能在我的C# 应用程序线程中运行外部进程(exe)? 我需要它,因为我不想要当我的 程序崩溃时,他们再跑了。另外,我不想在任务管理器中显示进程。

Is there a possibility to run an external process (exe) in on of my C# Apps Thread? I would need that because I don''t want them to run anymore when my programm crashes. Also I don''t want to have the processes visible in the task manager.

推荐答案

Tyron写道: 是否有可能在我的C#应用程序线程中运行外部进程(exe)? 是的,但它不会帮助你。 我需要这个,因为我不希望它们再次运行了程序崩溃了。 当您发现崩溃时,您必须手动终止进程。 此外,我不想让进程可见任务经理。 Is there a possibility to run an external process (exe) in on of my C# Apps Thread? Yes, but it won''t help you. I would need that because I don''t want them to run anymore when my programm crashes. You''d have to manually kill the process when you detect a crash. Also I don''t want to have the processes visible in the task manager.

如果它是一个单独的过程,它将在任务管理器中可见。 现在,如果它是另一个.NET应用程序,你可以在不同的 AppDomain中加载它并适当地调用Main方法。哎呀,你可以用很多工作的非.NET可执行文件做到这一点。我不希望它是特别可靠的。 Jon

If it''s a separate process, it would be visible in task manager. Now, if it''s another .NET app you could load it in a different AppDomain and call the Main method appropriately. Heck, you could probably do that with non-.NET executables with a lot of work. I wouldn''t expect it to be particularly reliable though. Jon

如果你创建一个新流程,它将是一个新流程:) 你可以做的是终止流程(Process.Kill)当你的程序 结束时,为此你需要挂钩AppDomain.DomainUnload - Ignacio Machin, ignacio.machin AT dot.state.fl.us 佛罗里达州交通局 Tyron < TY ************ @ kath-kirche-vorarlberg.at>在消息中写道 news:11 ********************** @ t31g2000cwb.googlegr oups ... Hi, if you create a new process it will be, well , a new process :) what you can do is terminate the process ( Process.Kill ) when your program ends, for this you need to hook AppDomain.DomainUnload -- Ignacio Machin, ignacio.machin AT dot.state.fl.us Florida Department Of Transportation "Tyron" <ty************@kath-kirche-vorarlberg.at> wrote in message news:11**********************@t31g2000cwb.googlegr oups... 是否有可能在我的C#应用程序线程中运行外部进程(exe)?我需要这样做因为我不希望它们在我的<程序崩溃了。此外,我不想在任务管理器中看到进程。 Is there a possibility to run an external process (exe) in on of my C# Apps Thread? I would need that because I don''t want them to run anymore when my programm crashes. Also I don''t want to have the processes visible in the task manager.

从线程运行进程不会改变一切。过程 由您的应用程序启动,并且该过程必须单独停止或由外部力量停止。一个separte线程只是你主线程的子线程 。您需要做的是确保如果您的应用程序崩溃 它会在退出之前停止该过程。 - HTH, Kevin Spencer 微软MVP 专业Numbskull 努力工作是一种药物, 没有安慰剂。 Tyron < TY ************ @ kath-kirche-vorarlberg.at>在消息中写道 news:11 ********************** @ t31g2000cwb.googlegr oups ... Running a process from a thread is not going to change anything. the process is started by your app, and the process must either stop by itself or be stopped by an external force. A separte thread is only a child thread of your main thread. What you need to do is ensure that if your app "crashes" it stops the process before exiting. -- HTH, Kevin Spencer Microsoft MVP Professional Numbskull Hard work is a medication for which there is no placebo. "Tyron" <ty************@kath-kirche-vorarlberg.at> wrote in message news:11**********************@t31g2000cwb.googlegr oups... 是否有可能在我的C#应用程序线程中运行外部进程(exe)?我需要这样做因为我不希望它们在我的<程序崩溃了。此外,我不想在任务管理器中看到这些过程。 Is there a possibility to run an external process (exe) in on of my C# Apps Thread? I would need that because I don''t want them to run anymore when my programm crashes. Also I don''t want to have the processes visible in the task manager.

更多推荐

在线程中运行进程?

本文发布于:2023-11-16 02:14:35,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1600080.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:线程   进程

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!