做个服务,能判断进程的busy状态

解决方案 »

  1.   

    namespace WatchDog
    {
        public partial class WatchDogService : ServiceBase
        {
            public static int count = 3;
            EventLog m_myLog = null;
            MSNService.httpmsnhelpdeskopencomcnSoapClient m_MsnService = null;
            QQService.httpqqhelpdeskopencomcnSoapClient m_QQservice = null;        System.Timers.Timer m_notifyTimer = null;
            //The unit is seconds.
            private int m_checkServiceIntervalTime = 180;        public int CheckServiceIntervalTime
            {
                get { return m_checkServiceIntervalTime; }
                set { m_checkServiceIntervalTime = value; }
            }        private bool m_ifChecking = false;        public WatchDogService()
            {
                InitializeComponent();
            }        protected override void OnStart(string[] args)
            {
      

  2.   

    lude8880 坐地起价  问题你也不看看楼主结贴率  他能有分么
      

  3.   

    while(true)
    {
    Process[] oldP = Process.GetProcessesByName("msnmsger");
    if (oldP.Length < 1) { MessageBox.Show("你的MSN停止運行!", "注意"); return; }
    thread.sheep(1000);
    }
      

  4.   

      static Thread myThread;
            
            static void Main(string[] args)
            {
                myThread = new Thread(a);
                myThread.Start();
                Console.Read();
            }        static void a()
            {
                while (true)
                {
                    Process[] oldP = Process.GetProcessesByName("msnmsger");
                    if (oldP.Length < 1)
                    {
                        Console.Write("你的MSN停止運行!"); 
                        //return;
                    }
                    Thread.Sleep(1000);
                }
            }