Esempio n. 1
0
        void theBGthread_bgThread2Event(object sender, bgThread2.BgThreadEventArgs bte)
        {
            dbgOut("Host:" + bte.qData.sHost);
            try
            {
                //IP will be NULL if GetHost failed
                dbgOut("IP:" + bte.qData.IP.ToString());
            }
            catch (Exception)
            {
                dbgOut("IP:" + "null");       
            }
            dbgOut("Replies: " + bte.qData.iPingReplies);
            dbgOut("Count: " + bte.qData.iPingCount);
            dbgOut("ReplyTime: " + bte.qData.iPingReplyTime);
            dbgOut("Timeout: " + bte.qData.iPingTimeout);
            dbgOut("==================================");
            //n = new Nachricht();
            if (bte.qData.iPingCount != bte.qData.iPingReplies)
            {
                sbHTML.Append("<tr><td>" + bte.qData.sHost + "</td><td>failed" + "</td></tr>\r\n");
                dbgOut("Ping for host '" + bte.qData.sHost + "' failed");
            }
            else
            {
                sbHTML.Append("<tr><td>" + bte.qData.sHost + "</td><td>OK" + "</td></tr>\r\n");
                dbgOut("Ping for host '" + bte.qData.sHost + "' OK");
            }

            //dbgOut("qDataCount=" + bte.qData._iCount.ToString() + " numberOfQueuedData: " + numberOfQueuedData.ToString());

            if (bte.qData._iCount == numberOfQueuedData)
            {
                //end html
                closeHTML();
                //write report file
                //System.IO.TextWriter stringWriter = new System.IO.StringWriter();
                try
                {
                    System.IO.TextWriter streamWriter = new System.IO.StreamWriter(szHtmlFile);
                    streamWriter.WriteLine(sbHTML);
                    streamWriter.Flush();
                    streamWriter.Close();
                }
                catch (Exception x)
                {
                    addLog("Exception in write HTML: " + x.Message);
                }

                //start notification
                showNotification();
                bQuitIsOK = true;
            }
        }
Esempio n. 2
0
 void myStreamReaderThread_bgThread2Event(object sender, bgThread2.BgThreadEventArgs bte)
 {
     AddRawText(bte.sString);
 }