public Form1() { InitializeComponent(); lblPingOptions.Text = myPingOptions.ToString(); _myPing = new myPing(); myPing.onReplyEvent += new myPing.ReplyEventHandler(_myPing_onReplyEvent); //sample usage: _myPing.doPing("192.168.128.5", myPingOptions); }
void _myPing_onReplyEvent(object sender, myPing.PingReplyEventArgs args) { addLog(args.message); if(args.replytype==myPing.PingReplyTypes.done) enableButton(true); }