From: shadow-monster via DotNetMonster.com on
Good Day,

I am using visual studio.net. I want to know if there's a way to end a
certain process that is running or prevent it from executing while my program
is running...

Here's what I wanna do, I have a program, when I start it, another program
conflict with it. I want that program automatically kill when I use my
program, also if it is not running it cannot execute while my program is
running. I hope you understand my sentence cause I'm not good in English.

Thanks,

--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/Forums.aspx/dotnet-csharp/201005/1

From: Peter Duniho on
shadow-monster via DotNetMonster.com wrote:
> Good Day,
>
> I am using visual studio.net. I want to know if there's a way to end a
> certain process that is running or prevent it from executing while my program
> is running...
>
> Here's what I wanna do, I have a program, when I start it, another program
> conflict with it. I want that program automatically kill when I use my
> program, also if it is not running it cannot execute while my program is
> running. I hope you understand my sentence cause I'm not good in English.

Don't write your program to do that.

Just display a message to the user, informing them of the conflict and
instructing them to resolve it. They then have the option of either
shutting down the other program, or yours.

Even better would be to fix your program so that it does not conflict
with the other one. Conflicts between programs are unusual, and this is
especially true for .NET applications. You should think carefully about
whatever it is that is causing the conflict to occur, and look for a
different implementation that does not cause a conflict.

Pete
From: Arne Vajhøj on
On 31-05-2010 01:18, shadow-monster via DotNetMonster.com wrote:
> I am using visual studio.net. I want to know if there's a way to end a
> certain process that is running or prevent it from executing while my program
> is running...
>
> Here's what I wanna do, I have a program, when I start it, another program
> conflict with it. I want that program automatically kill when I use my
> program, also if it is not running it cannot execute while my program is
> running.

Process.GetProcessByXxxxx(...).Kill()

should kill another process.

I am not sure that I like the behavior of such a program though.

Arne