windows服务与桌面交互的问题
wanok 2007-06-27 02:11:27 我做一个windows服务,里面有个定时器,定期启动一个进程。
下面是我的定时器执行函数
private void timer1_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
MessageBox.Show("hello");
Process proc=new Process();
proc.StartInfo.FileName="iexplorer.exe"; proc.StartInfo.WindowStyle=ProcessWindowStyle.Normal;
bool result = proc.Start();
MessageBox.Show(result?"sucess":"fail");
}
不知道为什么前面的MessageBox.Show能出窗体,后面的启动进程和show窗体死活出不来。哪位能指教下,谢谢