在c#后台执行programm [英] execute programm in background in c#

查看:78
本文介绍了在c#后台执行programm的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hai everyone

我需要一个建议,如何在后台执行一个程序到现在我能够在我的Web应用程序中运行后台程序但我需要的是我需要编译如果我需要显示的程序中有任何错误,则每次在后台运行程序并将结果存储在表中。



希望任何人都可以建议我。





谢谢和问候,

hai everyone
I need a suggestion that how to execute a programm in the background upto now i can able to run a programm in background in my web application but what i need is i need to compile and run the programm in the background and store the result in the table everytime if there are any errors in the programm i need to display.

Hope can anybody able to suggest me.


Thanks &Regards,

推荐答案

你可以通过多种方式做到这一点。

1.您可以创建一个线程并设置其属性背景。需要时从应用程序启动线程。

2.您可以从Web应用程序中使用System.ComponentModel.BackgroundWorker类。它将关注所有后台程序运行的工作。

3.您可以创建一个运行程序并异步执行该方法的方法。

4.如果可以运行您的Web应用程序中的可执行文件然后请阅读文章

在ASP.NET中运行.exe并使用AppDomain捕获异常 [ ^ ]
Various ways you can do it.
1. You can create a thread and set its property background. Start the thread when you need from your application.
2. You can use System.ComponentModel.BackgroundWorker class from your web application. It will take care all your background program running job.
3. You can create a method which run the program and execute that method asynchronously.
4. If you can run an executable from your web application then please read the article
Run .exe inside ASP.NET and catch exception using AppDomain[^]


这篇关于在c#后台执行programm的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆