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();
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();
相关文章推荐
- C#获取程序的当前路径,启动和关闭一个Process
- c#使用process.start启动程序报错解决方法
- C# - 多线程 之 Process与Thread与ThreadPool
- 【原創】關於C#程序調用Process.Start并获得启动参数的問題
- C#中通过Process启动的外部第三方程序MainWindowHandle句柄为0
- C# 用Process启动系统资源
- C# 多线程开发 1:使用 Thread 类创建与启动线程
- C#做服务使用Process启动外部程序没窗体
- c#的Process启动另一个进程作为程序的一个界面
- C#中如何使用Process.Start()使一个无gui的exe应用程序在后台启动 .
- C#中如何使用Process.Start()使一个无gui的exe应用程序在后台启动
- C#使用Process.Start启动程序出错“Unknown error (0xffffffff)”的解决方法
- c#Process.Start()启动报错,双击正常打开
- c#Process.Start无法启动exe程序的问题
- c#Process.Start无法启动exe程序的问题
- c#Process.Start无法启动exe程序的问题
- C# Thread类的应用
- C# Process.Start()方法详解
- android:process用于在新进程中启动Activity
- c#怎样打包 可以使另一个程序随开机自动启动