Example #1
0
        public MainPage()
        {
            InitializeComponent();

            outputBox.PrintWelcomeMsg();

            _jarper = new JArper();

            _netCardInfo = _jarper.GatherNetworkDeviceInfo();
            if (_netCardInfo == null)
            {
                ExitProgram();
            }

            _netCardInfo.CaptureDevice.OnPacketArrival += new PacketArrivalEventHandler(device_OnPacketArrival);

            _netCardInfo.CaptureDevice.OpenDevice();

            outputBox.PrintNetworkInfo(_netCardInfo.CaptureDevice, new List <string>
            {
                _netCardInfo.OurIpAddress.ToString(),
                _netCardInfo.GatewayIpAddess.ToString(),
                _netCardInfo.SubnetMask.ToString(),
                _netCardInfo.OurMacAddress.ToString(),
            });

            TextBoxWriterExtensionss.PreFillTextBoxes(macTxtBox, ipTxtBox, _netCardInfo.OurMacAddress.ToString(), _netCardInfo.OurIpAddress.ToString());

            //Event driven from here...
        }
Example #2
0
        private ScanResult PerformScan(JCaptureDevice dev)
        {
            ScanResult scanResult = new ScanResult();

            Stopwatch stopWatch = StartStopwatch();

            scanResult.OnlineClients = _jarper.ScanSubnet(dev.CaptureDevice, _ipsInSubnet, _onlineClients, dev.OurMacAddress, dev.OurIpAddress);

            stopWatch.Stop();

            scanResult.Duration = stopWatch.ElapsedMilliseconds;

            return(scanResult);
        }