使用 C# 进行网络编程
我有一个项目要做,就是数据包监控。 我想捕获指定网络接口接收的每个数据包。
我想知道我应该从什么开始做我的项目...... 我应该先学习套接字编程还是什么? 我应该学习如何在 C# 下使用 winpcap 还是只做我自己的功能。
请建议我应该从哪里开始!
我知道互联网上有很多 C# 代码,但我想自己学习,但我不知道从哪里开始!
I have a project to do which is packet monitoring.
I want to capture each packet receive by specified network interface.
I want to know what I should start with to do my project ....
should I learn socket programming first or what?
should I learn how to use winpcap under C# or just do my own function.
please advice me from where I should start!!!
I know there are many code in C# out there in the internet for this but I want to learn it by myself but I do not know from where to star!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您肯定应该首先学习套接字编程的基础知识,这样您就可以了解一些正在发生的事情。接下来,我将研究使用 WinPCap 进行编程,这是一个数据包捕获库。它不是直接为 .NET 构建的,但我相信,有 .NET 包装器,或者如果没有别的办法,您可以使用 COM Interop 来调用这些函数。
You sould definitely learn the basics of socket programming first so you understand a little bit about what's going on. Next, I would look into programming using WinPCap, which is a packet capturing library. It's not built directly for .NET but there are, I believe, .NET wrappers or if nothing else you could call the functions by using COM Interop.
我同意使用 WinPcap 可能是一个好主意。具体来说,请查看 SharpPcap。它得到积极维护。事实上,今天已经发布了。
I agree using WinPcap is probably a good idea. Specifically, look at SharpPcap. it is actively maintained. In fact, there was a release today.
我建议使用 Pcap.Net。
它是 WinPcap 包装器的一个非常活跃的 .NET 包装器,具有庞大的数据包解释库。它具有出色的品质和性能。
I recommend using Pcap.Net.
It is a very active .NET wrapper for WinPcap wrapper with a vast packet interpretation library. It has great quality and performance.