예제 #1
0
        public static PingLogger Instance()
        {
            if (instance == null)
            {
                instance = new PingLogger();
            }

            return(instance);
        }
예제 #2
0
        public Pinger(string IPadress)
        {
            address = IPAddress.Parse(IPadress);

            BackgroundWorker BW = new BackgroundWorker();

            BW.WorkerSupportsCancellation = true;
            BW.DoWork += new DoWorkEventHandler(BW_doWork);

            pingSender.PingCompleted += new PingCompletedEventHandler(ping_Complete);
            Attach(PingLogger.Instance());
            if (!BW.IsBusy)
            {
                BW.RunWorkerAsync();
            }
        }