示例#1
0
        private void Timer_Elapsed(object sender, ElapsedEventArgs e)
        {
            RmtObject         rmtObject         = new RmtObject();
            ServiceController serviceController = new ServiceController("ServiceB");

            Log("ServiceB : " + serviceController.Status.ToString());
            Log("Count : " + rmtObject.Count++);

            if (serviceController.Status.Equals(ServiceControllerStatus.Stopped))
            {
                serviceController.Start();
            }
        }
示例#2
0
 private void Timer_Tick(object sender, EventArgs e)
 {
     try
     {
         int       temp;
         RmtObject rmtObject = new RmtObject();
         temp        = rmtObject.Count;
         label4.Text = rmtObject.Count.ToString();
     }
     catch (RemotingException ex)
     {
         Debug.WriteLine(ex);
         label4.Text = "Ipc 연결 되지 않음";
     }
     serviceA.Refresh();
     serviceB.Refresh();
     ServiceA_Status.Text = serviceA.Status.ToString();
     ServiceB_Status.Text = serviceB.Status.ToString();
 }