Click here to Skip to main content
15,878,602 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
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?
Posted

1 solution

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

C#
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;
        }
 
Share this answer
 
v2
Comments
Zoltán Zörgő 16-Sep-13 7:35am    
Messagebox in asp.net server side?????
Sriram Bala 16-Sep-13 7:40am    
Hi. Sorry I am working in Windows application so Overlooked the requirement is in ASP.Net. User can remove the Message box stuff, however this piece of code will give the user an idea which he can modify for his requirement. By the way Nice catch. :-)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900