c# 大侠们给我看看这几句程序 非常简单的 所以现在tgtmac 跟 tgtaddr 都是啥呢? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 buffer.CopyTo(4, tgtMac, 0, 8); buffer.CopyTo(12, tgtAddr, 0, 2); buffer.CopyTo(15, Car_BYFloor, 0, 1); buffer.CopyTo(16, strStall, 0, 3); 这几句是什么意思 鼠标放到 CopyTO上面 然后F12一切秘密将浮现出来 0X为前缀的代表是16进制的数据 比如0x123其实就代表123,但是16进制有abcdef 所以会有这样的0x1a2b,上面所有的数组 都存0 不知道是啥意思 using System.Net.NetworkInformation;using System.Net;using System.Xml;using System.Runtime.InteropServices;//使用DllImport的空间引用声明 [DllImport("Iphlpapi.dll")] public static extern uint SendARP(uint DestIP, uint SrcIP, ref ulong pMacAddr, ref uint PhyAddrLen); public static int Num = 0; byte[] submask = { 0, 0, 0, 0 }; byte[] localip = { 0, 0, 0, 0 }; byte[] netip = { 0, 0, 0, 0 }; int[] temp = { 0, 0, 0, 0 }; byte[] destip = { 0, 0, 0, 0 }; public static string IP; public static string Mac; public static string ItemFlag; //Thread thread1; //在主线程中声明线程1 // Thread thread2; //在主线程中声明线程2 delegate void daililist();//主线程之外的线程要调用main线程中建立的控件,需要使用委托 的方式,此处是委托的定义 public delegate void UpdateList(string ip, string result); public delegate void UpdateLabel(); public static string GetMac(string p_Id) { IPAddress _Address; if (!IPAddress.TryParse(p_Id, out _Address)) return ""; uint DestIP = System.BitConverter.ToUInt32(_Address.GetAddressBytes(), 0); ulong pMacAddr = 0; uint PhyAddrLen = 6; uint error_code = SendARP(DestIP, 0, ref pMacAddr, ref PhyAddrLen); byte[] _Bytes1 = BitConverter.GetBytes(pMacAddr); return BitConverter.ToString(_Bytes1, 0, 6).Replace("-", ""); } StringBuilder lst_NetworkAdapter = new StringBuilder(); private void simpleButton3_Click(object sender, EventArgs e) { textBox1.Text = GetMac(textBox1.Text.ToString().Trim()); label1.Text = "mac地址"; } 不知道是不是你想要的 byte和Byte的区别大概是byte是C#的预定义数据类型,而它在.Net中对应的数据类型是System.Byte,在C#程序头部已经using System; ,所以在代码中都可以使用这两种形式 combobox datagridview 显示有效值的问题 应该是个系统相关的设置问题 枚举数是什么 vb.net中的Chr()在C#.NET中怎么实现 求高手帮帮我 如果在WebBrowser中写代码清空IE的cookie 请问如何得到以下情况的数组的元素个数? 程序为什么会在GUI线程中卡死 两个DateTime类型的数据,如何求他们之间相差几天,几个月,几年 cefsharp 实现 谷歌 F12 右键Focus 功能 c#水晶报表显示图片的问题 winform 把窗口上的全部信息生成PDF文件显示??
buffer.CopyTo(12, tgtAddr, 0, 2);
buffer.CopyTo(15, Car_BYFloor, 0, 1);
buffer.CopyTo(16, strStall, 0, 3);
这几句是什么意思
using System.Net;
using System.Xml;
using System.Runtime.InteropServices;//使用DllImport的空间引用声明
[DllImport("Iphlpapi.dll")]
public static extern uint SendARP(uint DestIP, uint SrcIP, ref ulong pMacAddr, ref uint
PhyAddrLen);
public static int Num = 0;
byte[] submask = { 0, 0, 0, 0 };
byte[] localip = { 0, 0, 0, 0 };
byte[] netip = { 0, 0, 0, 0 };
int[] temp = { 0, 0, 0, 0 };
byte[] destip = { 0, 0, 0, 0 };
public static string IP;
public static string Mac;
public static string ItemFlag;
//Thread thread1; //在主线程中声明线程1
// Thread thread2; //在主线程中声明线程2
delegate void daililist();//主线程之外的线程要调用main线程中建立的控件,需要使用委托 的方式,此处是委托的定义
public delegate void UpdateList(string ip, string result);
public delegate void UpdateLabel();
public static string GetMac(string p_Id)
{
IPAddress _Address;
if (!IPAddress.TryParse(p_Id, out _Address)) return "";
uint DestIP = System.BitConverter.ToUInt32(_Address.GetAddressBytes(), 0);
ulong pMacAddr = 0;
uint PhyAddrLen = 6;
uint error_code = SendARP(DestIP, 0, ref pMacAddr, ref PhyAddrLen);
byte[] _Bytes1 = BitConverter.GetBytes(pMacAddr);
return BitConverter.ToString(_Bytes1, 0, 6).Replace("-", "");
}
StringBuilder lst_NetworkAdapter = new StringBuilder(); private void simpleButton3_Click(object sender, EventArgs e)
{
textBox1.Text = GetMac(textBox1.Text.ToString().Trim());
label1.Text = "mac地址";
}
不知道是不是你想要的