TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
softairhk
NA
115
0
How to get the Process Name in C#?
Feb 13 2004 1:58 AM
Hello! I would like to write an application that can check if my application is running or not? What I know to do is checking the application is in the list of Process or not, e.g. demoapp.exe. I know that in C# we can use Process.GetProcess("demoapp"), but it always prompt for error, why? The following is my supposed method: private void Monitor() { string sProcessName = Process.GetProcess("demoapp"); string sCompare = "demoapp"; if(sProcessName=sCompare) { Process.Start("d:\temp\demoapp.exe"); } else { MessageBox.Show("The application is running","Warning"); } } Please give me reply asap. Thanks!
Reply
Answers (
2
)
FileSystemWatcher.WaitForChanged() ???
how to transfer a dataset from server to client with tcp/ip?