所以现在tgtmac 跟 tgtaddr 都是啥呢?

解决方案 »

  1.   

                               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);  
    这几句是什么意思
      

  2.   

    鼠标放到 CopyTO上面 然后F12一切秘密将浮现出来
      

  3.   

    0X为前缀的代表是16进制的数据 比如0x123其实就代表123,但是16进制有abcdef  所以会有这样的0x1a2b,上面所有的数组 都存0 不知道是啥意思  
      

  4.   

     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地址";
            }
     不知道是不是你想要的
      

  5.   

    byte和Byte的区别大概是byte是C#的预定义数据类型,而它在.Net中对应的数据类型是System.Byte,在C#程序头部已经using System; ,所以在代码中都可以使用这两种形式