exe在后端运行 [英] exe running in Backend

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

问题描述

我有一个开发一个Web应用程序。在这个应用程序中,我需要一个cheeking,这是一个che cheking

假设有两到四个exe在后台运行如何知道这些exe正在运行是正确的还是不是在这个脸颊需要vb.net

所以你能帮助我吗?

I have Develope One Web-Application.In this Application i have need one Cheeking that is exe cheeking
Suppose two to four exe is running in background how to know those exe is running is properly or not in this cheek need for vb.net
so do you help me anybody?

推荐答案





如果我理解你正确的问题,你需要杀死应用程序运行过程的多个实例。下面用C#中的代码可以帮到你。



谢谢,

Sriram.B



Hi,

If I understood you question correctly you need to kill multiple instances of application running processs. Below code in C# will help you I think.

Thanks,
Sriram.B

public  bool TerminateProcess(string strProcessName)
        {
            foreach (Process windowprocess in Process.GetProcesses())
            {
                if (windowprocess.ProcessName == strProcessName)
                {
                    MessageBoxResult result = MessageBox.Show("Would you like to automatically close running Process.", "Application Name", MessageBoxButton.YesNo, MessageBoxImage.Question);
                    if (result == MessageBoxResult.Yes)
                    {
                        foreach (Process process in Process.GetProcesses())
                        {
                            if (process.ProcessName == strProcessName)
                                windowprocess.Kill();
                        }
                        return true;
                    }
                    return false;
                }
            }
            return true;
        }


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

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