示例#1
0
        public void Log(HostPinger host, string message)
        {
            PingForm.NotifyMessage(host, message);

            lock (this)
            {
                _fileWriter.WriteLine(LOG_ROW_FORMAT, DateTime.Now, host.HostIP, host.HostName, message);
                _fileWriter.Flush();
            }
        }
示例#2
0
 public static void NotifyMessage(HostPinger host, string message)
 {
     if (Application.OpenForms.Count > 0)
     {
         PingForm frm = ((PingForm)Application.OpenForms[0]);
         if (frm != null)
         {
             frm._notifyIcon.ShowBalloonTip(10000, host.HostName + "(" + host.HostIP.ToString() + ")",
                                            message, ToolTipIcon.Info);
         }
     }
 }