您的位置:首页 > 编程语言 > C#

C# 中Process 和 Thread 的启动

2007-10-18 19:00 417 查看
Start Process

Process[] oeProcess = Process.GetProcessesByName("msimn");

if (oeProcess == null || oeProcess.Length == 0) {

try {

string oeExeFile =

string.Format(@"{0}\Outlook Express\msimn.exe", Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles));

if (File.Exists(oeExeFile)) {

Process process = Process.Start(oeExeFile);

Thread.Sleep(7*1000);

} else {

MessageBox.Show("Start Outlook Express failure , for Outlook Express is not exist !");

return false;

}

} catch (Exception exp) {

throw new Exception("Start Outlook Express failure , for "+exp.Message,exp);

}

}

return true;

Start Thread

ThreadStart threadStart = new ThreadStart(ImageAutoWatch);

imageWatchThread = new Thread(threadStart);

imageWatchThread.Start();
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: