c 로 만들어진 packet 라이브러리 다운
https://www.winpcap.org/install/default.htm
WinPcap · Download
WinPcap Has Ceased Development. We recommend Npcap. The WinPcap project has ceased development and WinPcap and WinDump are no longer maintained. WE RECOMMEND USING Npcap INSTEAD. If you do insist upon using WinPcap, be aware that its installer Uses NDIS 5.
www.winpcap.org
https://sourceforge.net/projects/sharppcap/
SharpPcap
Download SharpPcap for free. NOTE: Project has moved to github, including file downloads. SharpPcap is a cross-platform packet capture framework for the .NET environment, based on the famous pcap / WinPcap libraries.
sourceforge.net
c 용으로 만들어진 라이브러리를 c# 용으로 바꿔주는 dll 다운
다운
압축 풀어서 release 에 dll 파일 두개 c# 참조 추가하기에서 추가하자
간단한 버전 확인 해주는 코드
using SharpPcap;
using System;
namespace packat
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("SharpPcap : 버전 "+SharpPcap.Version.VersionString);
Console.WriteLine("Pcap : 버전 " + Pcap.Version.Substring(0, Pcap.Version.IndexOf(',')));
}
}
}
내컴퓨터에서 capture 가능한 인터넷 장비에 대한 정보 출력
static void Main(string[] args)
{
Console.WriteLine("인터넷 장치 숫자 : "+SharpPcap.CaptureDeviceList.Instance.Count.ToString()); // NIC(랜카드) 장치 숫자
foreach (var item in SharpPcap.CaptureDeviceList.Instance)
{
if (item.ToString().IndexOf("FriendlyName") != -1)
{
Console.WriteLine(item.ToString().Split('\n')[1]);
}
}
}
'공부,일 > C# 네트워크' 카테고리의 다른 글
packet 분석기 만들기 (3) (0) | 2021.09.15 |
---|---|
packet 분석기 만들기 (2) HexaViewer , NIC 선택 (0) | 2021.09.10 |
20210818 네트워크 프로그래밍 채팅 프로그램 만들기 (M:M) (1) | 2021.08.18 |
1:1 채팅 만들기 socket (0) | 2021.08.17 |
210817 쓰레드 (0) | 2021.08.17 |
댓글