c# - 如何使用 C# 发送原始以太网数据包?

标签 c# .net windows-7 network-programming raw-ethernet

<分区>

有没有办法通过 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 Manipulationmirror 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/

相关文章:

c# - 从json windows phone解析字典

c# - 文件系统 TreeView

c# - 不安全代码无法在 Visual Studio 2015 上编译

.net - vb.net - 如何将今天设置为时间选择器的默认日期?

delphi - 如何在 Windows 7 中获取域名

java - Java 首选项存储在 Windows 7 中的什么位置?

c# - 单击时如何使命令不禁用按钮

.net - 如何让辅助角色应用程序访问Web角色实例中的文件

batch-file - 如何在Windows中设置默认的Python版本?

c# - 使用 MVVM 模式时,我应该将与 View 紧密连接但体积庞大的方法放在哪里?