Click here to Skip to main content
16,012,025 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
plz suggest me......thanks in advance
Posted

By using task manager? If you need to do this with code to your app(s) then you have a problem in your design approach
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 28-Aug-11 18:19pm    
I agree with you, my 5. However, this is not an answer. In some cases there is no other work-around (I hate to admit that, please see my comment to the post by Griff).
See also my answer. You opinion is credited.
--SA
This is done via System.Diagnostics.Process.Kill. It's your business where you get a reference to a Process instance. It could be a process that you have started yourself via System.Diagnostics.Process.Start, it can be a process from the list of processes obtained via System.Diagnostics.Process.GetProcesses, System.Diagnostics.Process.GetProcessesByName, etc. After all, it can be your current process which you have trouble to terminate normally by any reasons.

In all cases this is a good sign that your development is in deep crisis, so you will need to fix the design. I agree with Simon Whale, please see my comments.

—SA
 
Share this answer
 
v2
Comments
Simon_Whale 28-Aug-11 18:51pm    
my +5 SA
Sergey Alexandrovich Kryukov 28-Aug-11 19:11pm    
Thank you, Simon.
--SA
jincy1690 29-Aug-11 1:33am    
Thanks a lots...Have a nice day
Sergey Alexandrovich Kryukov 29-Aug-11 11:09am    
You're welcome.
Good luck, call again.
--SA
Why would you want to do that? I can't think of a reason that wasn't malicious...
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 28-Aug-11 18:17pm    
I can give you some real-life reason. Sometime you're using a lousy 3rd-party component which prevent closing a current process normally. Of course you have to get rid of it, but... for now this is the only library (without source code) supporting your hardware which cost you good amount of money. If you deal with "industrial-grade" hardware, it happens all the time -- almost all of those people have no idea how to program (but they do).

There are many other cases. Even more typical case is the idiotic architecture. Malicious indent is the most unlikely.
--SA
jincy1690 29-Aug-11 1:46am    
I'm just trying to do it..I'm so confused,How can i do this because this functionality is required in our project term that given by our professor Mr.ketwani....thanks 4 giving me a great response.again thanx

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