PowerBulider obtain computer mac address

PowerBulider obtain computer mac address

1, download GETNET.DLL API access to network resources

2, the introduction of global functions required in the API PB, the following list of common API

//得到计算机名字
function boolean GetComputerNameA(ref string  lpBuffer, ref ulong nSize) library "KERNEL32.DLL" alias for "GetComputerNameA;Ansi"
//设置计算机名字
FUNCTION boolean SetComputerNameA(ref string cname)LIBRARY "kernel32.dll" alias for "SetComputerNameA;Ansi"
//设置系统时间
Function boolean SetSystemDateTime(integer wYear,integer wMonth,integer wDay,integer wHour,integer wMinute,integer wSecond) Library "mHand.dll"
FUNCTION int GetSystemMetrics(int indexnum)LIBRARY "User32.dll"
//通过域名得到IP
Function string GetIp(string name) Library "GetNet.dll" alias for "GetIp;Ansi"
//得到本机IP地址
Function string GetLocalIp() Library "GetNet.dll" alias for "GetLocalIp;Ansi"
//通过ip得到域名
Function string GetName(string ip) Library "GetNet.dll" alias for "GetName;Ansi"
//得到本机域名
Function string GetLocalName() Library "GetNet.dll" alias for "GetLocalName;Ansi"
//得到局域网内的计算机名
Function string GetLanComputers() Library "GetNet.dll" alias for "GetLanComputers;Ansi"
//得到局域网内的计算MAC
Function string GetMac(string ip) Library "GetNet.dll" alias for "GetMac;Ansi"
//得到本机的计算MAC
Function string GetLocalMac() Library "GetNet.dll" alias for "GetLocalMac;Ansi"

3, noted that the acquisition of the Mac address will vary depending on the local computer.

  • Usually there will be a plurality of notebook mac address, a wireless network connection using a mac address, mac address using a wired connection, the other part of the address mac address for transmitting data between the interactive program. Consider the actual demand
  • Mac desktop computers will address the lack of a Wi-Fi than a laptop

4, can be packaged packaged together.

Guess you like

Origin www.cnblogs.com/mark-0001/p/11525504.html