示例#1
0
        public static DHCP_CLIENT_UID ConverToNativeMac(string mac)
        {
            DHCP_CLIENT_UID nativeMac = new DHCP_CLIENT_UID();

            nativeMac.Data       = MacPtr(StringToByteArray(mac));
            nativeMac.DataLength = (uint)mac.Length / 2;
            return(nativeMac);
        }
示例#2
0
 public static string ByteToString(DHCP_CLIENT_UID mac)
 {
     string macAddress = String.Format("{0:x2}-{1:x2}-{2:x2}-{3:x2}-{4:x2}-{5:x2}",
                             Marshal.ReadByte(mac.Data),
                             Marshal.ReadByte(mac.Data, 1),
                             Marshal.ReadByte(mac.Data, 2),
                             Marshal.ReadByte(mac.Data, 3),
                             Marshal.ReadByte(mac.Data, 4),
                             Marshal.ReadByte(mac.Data, 5));
     return macAddress;
 }
示例#3
0
        public static string ByteToString(DHCP_CLIENT_UID mac)
        {
            string macAddress = String.Format("{0:x2}-{1:x2}-{2:x2}-{3:x2}-{4:x2}-{5:x2}",
                                              Marshal.ReadByte(mac.Data),
                                              Marshal.ReadByte(mac.Data, 1),
                                              Marshal.ReadByte(mac.Data, 2),
                                              Marshal.ReadByte(mac.Data, 3),
                                              Marshal.ReadByte(mac.Data, 4),
                                              Marshal.ReadByte(mac.Data, 5));

            return(macAddress);
        }
示例#4
0
 public static DHCP_CLIENT_UID ConverToNativeMac(string mac)
 {
     DHCP_CLIENT_UID nativeMac = new DHCP_CLIENT_UID();
     nativeMac.Data = MacPtr(StringToByteArray(mac));
     nativeMac.DataLength = (uint)mac.Length / 2;
     return nativeMac;
 }