|
-
Nov 26th, 2006, 12:17 PM
#1
Thread Starter
Lively Member
[RESOLVED] Process is running.
how do i check if a process is running, im making a program that starts "notepad" etc, if it aint allready open...
something like, if process("notepad") running then
----
else
run notepad
kinda thing
-
Nov 26th, 2006, 12:55 PM
#2
Re: Process is running.
The correct namespace is: System.Diagnostics.Process
VB Code:
private void IsNotePadRunning()
{
System.Diagnostics.Process[] pro = System.Diagnostics.Process.GetProcessesByName("notepad");
if (pro.GetLength(0) > 0)
{
//do your work here
}
else
{
System.Diagnostics.Process.Start("notepad.exe");
}
}
-
Nov 26th, 2006, 01:00 PM
#3
Thread Starter
Lively Member
Re: Process is running.
It works perfect thx dude
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|