<分区>
有没有办法通过 C# 将原始数据包以太网发送到其他主机?在 Windows 7 中,如果它有所不同。
<分区>
有没有办法通过 C# 将原始数据包以太网发送到其他主机?在 Windows 7 中,如果它有所不同。
最佳答案
根据 Saint_pl 的建议:
I found probably better solution - similar to SharpPcap. It's Pcap.Net - .NET wrapper for WinPcap. Now I can modify my packets whatever I want.
我为您提供了一些可能有用的资源。我没有在 Windows 7 中尝试该解决方案,但它可能包含一些很好的入门信息。
Raw Ethernet Packet Manipulation或 mirror on CodeProject
This purpose of this article is to explain how to send a raw Ethernet packet using C# on a Microsoft platform. A raw Ethernet packet is the complete Layer 2 network frame that is sent to the physical wire. Sending a frame like this allows you to manipulate the target and source MAC addresses and the Layer 3 protocol fields.
还有一些关于原始套接字的信息(以防你也感兴趣):
Client (and Server) Sockets Communication查看整章,但这里是关键部分:
不发送数据包但可能很有趣:A Network Sniffer in C# , SharpPcap - A Packet Capture Framework for .NET
关于c# - 如何使用 C# 发送原始以太网数据包?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3964013/