如何在Windows中使用C#捕获LAN数据包? [英] how to capture lan packets using c# in windows??
本文介绍了如何在Windows中使用C#捕获LAN数据包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在Windows中使用C#捕获局域网数据包?
how to capture lan packets using c# in windows??
推荐答案
您不能.您需要微型端口驱动程序上的筛选器驱动程序,并且筛选器驱动程序不是托管代码.您也许可以找到一些适合您的库.
You can''t. You need a filter driver on the miniport driver, and filter drivers are not managed code. You may be able to find some library which does that for you.
这是Wireshark等程序使用的库:
http://www.winpcap.org/ [ ^ ]
This is the library used by programs like Wireshark:
http://www.winpcap.org/[^]
使用SharpPcap库
http://www.codeproject.com/KB/IP/sharppcap.aspx
USE SharpPcap Library
http://www.codeproject.com/KB/IP/sharppcap.aspx
这篇关于如何在Windows中使用C#捕获LAN数据包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文