Esempio n. 1
0
 //异常触发时事件
 private void ExecptionHandle(NetState modelIn)
 {
     if (isRemind)
     {
         ni.ShowBalloonTip(2000, modelIn.state, modelIn.name, ToolTipIcon.Warning);
     }
     if (isMail)
     {
         if ((DateTime.Now - lastTime).TotalMinutes >= TimeSpan || curName != modelIn.name)
         {
             formSend fs = new formSend()
             {
                 modelIn = modelIn
             };
             fs.SendMail();
             lastTime = DateTime.Now;
             curName  = modelIn.name;
         }
     }
     if (isLog)
     {
         T_Log modelLog = new T_Log()
         {
             LOGTIME = DateTime.Now, OBJNAME = modelIn.name, ADDRESS = modelIn.ip, STATE = modelIn.state, RETIME = modelIn.reTime
         };
         bllLog.Add(modelLog);
         //MessageBox.Show("记录");
     }
 }
Esempio n. 2
0
        private void btnMailTest_Click(object sender, EventArgs e)
        {
            formSend s = new formSend()
            {
                modelIn = new NetState()
            };

            s.SendMail();
        }