study study study
今天试着用C#控制win后台进程.发现了几个要注意的地方,记录下:
设置成手动,设为自动有些时候进程控制不到.
sc.Stop();sc.WaitForStatus(ServiceControllerStatus.Stopped, TimeSpan.FromSeconds(2));
WaitForStatus 这个方法很有用,可以设置进程等待时间.
posted on 2009-06-20 12:51 truedafei 阅读(641) 评论(0) 收藏 举报
博客园 © 2004-2026 浙公网安备 33010602011771号 浙ICP备2021040463号-3