首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

windows服务与桌面交互的有关问题

2012-01-11 
windows服务与桌面交互的问题我做一个windows服务,里面有个定时器,定期启动一个进程。下面是我的定时器执行

windows服务与桌面交互的问题
我做一个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窗体死活出不来。哪位能指教下,谢谢

[解决办法]
既然是服务了,怎么可能show一个窗口出来呢?

热点排行