Example #1
0
        private void Time2_Click(object sender, EventArgs e)
        {
            this.timer2.Stop();

            try
            {
                string dateTime = DateTime.Now.ToString("T");

                if (DateTime.Now.ToString("T").CompareTo(this.textBox_Morning.Text) == 0 ||
                    DateTime.Now.ToString("T").CompareTo(this.textBox_Noon.Text) == 0 ||
                    DateTime.Now.ToString("T").CompareTo(this.textBox_Eveing.Text) == 0)
                {
                    System.Threading.Thread.Sleep(1000);
                    if (CheckProcessIsOk())
                    {
                        string rm  = ComputerInfomation.get_StorageInfo().dwMemoryLoad.ToString();
                        string cpu = ComputerInfomation.getCPUUsage();

                        SendTextMessage("定时服务器自检触发,服务器运行监控预览:");
                        SendTextMessage("   1.Multicharts进程正常运行中...");

                        SendTextMessage("   2.内存容量占用率:" + rm + "%");

                        SendTextMessage("   3.CPU使用率:" + cpu + "%");

                        //3.完成截图;
                        //SendShotScreenOperater();
                    }
                    else
                    {
                        string rm  = ComputerInfomation.get_StorageInfo().dwMemoryLoad.ToString();
                        string cpu = ComputerInfomation.getCPUUsage();

                        SendTextMessage("定时服务器自检触发,服务器运行监控预览:");
                        SendTextMessage("   1.Multicharts进程崩溃,立即检查...");

                        SendTextMessage("   2.内存容量占用率:" + rm + "%");

                        SendTextMessage("   3.CPU使用率:" + cpu + "%");

                        //3.完成截图;
                        //SendShotScreenOperater();
                    }
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }


            this.timer2.Start();
        }
Example #2
0
        /// <summary>
        /// 收到新消息
        /// </summary>
        /// <param name="msg"></param>
        void _friendUser_MsgRecved(WXMsg msg)
        {
            ShowReceiveMsg(msg);

            if (msg.Msg.CompareTo("hi") == 0)
            {
                if (CheckProcessIsOk())
                {
                    string rm  = ComputerInfomation.get_StorageInfo().dwMemoryLoad.ToString();
                    string cpu = ComputerInfomation.getCPUUsage();

                    SendTextMessage("Hi,服务器实时运行监控预览:");
                    SendTextMessage("   1.Multicharts进程正常运行中...");

                    SendTextMessage("   2.内存容量占用率:" + rm + "%");

                    SendTextMessage("   3.CPU使用率:" + cpu + "%");

                    //3.完成截图;
                    //SendShotScreenOperater();
                }
                else
                {
                    string rm  = ComputerInfomation.get_StorageInfo().dwMemoryLoad.ToString();
                    string cpu = ComputerInfomation.getCPUUsage();

                    SendTextMessage("Hi,服务器运行监控预览:");
                    SendTextMessage("   1.Multicharts进程崩溃,立即检查...");

                    SendTextMessage("   2.内存容量占用率:" + rm + "%");

                    SendTextMessage("   3.CPU使用率:" + cpu + "%");

                    //3.完成截图;
                    //SendShotScreenOperater();
                }
            }
        }