コード例 #1
0
ファイル: frmMain.cs プロジェクト: byunkook/PacketModerator
        private void ListDevices()
        {
            Log("Generating Devices List");
            devices = SharpPcap.LibPcap.LibPcapLiveDeviceList.Instance;

            foreach (SharpPcap.LibPcap.LibPcapLiveDevice dev in devices)
            {
                lstDevices.Items.Add(dev.Description.ToString());
            }
        }
コード例 #2
0
        /// <summary>
        /// Represents a strongly typed, read-only list of PcapDevices.
        /// </summary>
        private CaptureDeviceList()
            : base(new List <ICaptureDevice>())
        {
            // windows
            if ((Environment.OSVersion.Platform == PlatformID.Win32NT) ||
                (Environment.OSVersion.Platform == PlatformID.Win32Windows))
            {
                nPcapDeviceList = Npcap.NpcapDeviceList.Instance;
            }
            else // not windows
            {
                libPcapDeviceList = LibPcap.LibPcapLiveDeviceList.Instance;
            }

            Refresh();
        }
コード例 #3
0
 /// <summary>
 /// Represents a strongly typed, read-only list of PcapDevices.
 /// </summary>
 private CaptureDeviceList()
     : base(new List <ILiveDevice>())
 {
     libPcapDeviceList = LibPcap.LibPcapLiveDeviceList.Instance;
     Refresh();
 }