コード例 #1
0
ファイル: dhcpclient.cs プロジェクト: Arclight05/dhcpsapi
        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
ファイル: dhcpclient.cs プロジェクト: meanbunny/dhcpsapi
 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
ファイル: dhcpclient.cs プロジェクト: Arclight05/dhcpsapi
        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
ファイル: dhcpclient.cs プロジェクト: meanbunny/dhcpsapi
 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;
 }