private void btnStart_Click(object sender, EventArgs e) { try { PacketMonitor.StartMonitor(); SetMonitorButtonStatus(); } catch (ArgumentException ex) { MessageBox.Show($"{ex.Message}.\r\rRun command IpConfig /all at a windows CMD prompt to find your network.", "Packet Monitor Failed to Start", MessageBoxButtons.OK, MessageBoxIcon.Warning); } catch (Exception ex) { MessageBox.Show("Exception occurred: " + ex.ToString(), "Packet Monitor Failed to Start", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
static void Main(string[] args) { var pm = new PacketMonitor(); pm.OnPingSample += PmOnOnPingSample; var monitor = new FFXIVNetworkMonitor(); monitor.MessageReceived = pm.MessageReceived; monitor.MessageSent = pm.MessageSent; monitor.Start(); Console.WriteLine("Press any key to stop..."); Console.ReadKey(); monitor.Stop(); }
private void btnStop_Click(object sender, EventArgs e) { PacketMonitor.StopMonitor(); SetMonitorButtonStatus(); }
void PMonitor_NewPacket(PacketMonitor pm, Packet p) { p.DestinationAddress.ToString();//throw new NotImplementedException(); }
private void Form1_Load(object sender, EventArgs e) { PMonitor = new PacketMonitor(System.Net.IPAddress.Parse("DOSSTONED")); PMonitor.NewPacket += new NewPacketEventHandler(PMonitor_NewPacket); PMonitor.Start6(); }