草原上的野狼

啸苍天,没日月,孤单影只; 忍地寒,耐绝境,经熔炼,将成大业!

  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 :: 管理 ::

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();

posted on 2007-10-18 19:00  血狼  阅读(2492)  评论(0)    收藏  举报