WM上能不能获取本机地址?
WM机器上能不能获取本机地址? PC上可以有localhost/127.0.0.1 WM上有没有相应的方法?谢谢。
[解决办法]
gethostname(Buff, 256);
LocalAddress = gethostbyname(Buff);
sprintf(Buff, "%d.%d.%d.%d\0", LocalAddress->h_addr_list[0][0] & 0xFF, LocalAddress->h_addr_list[0][1] & 0x00FF, LocalAddress->h_addr_list[0][2] & 0x0000FF, LocalAddress->h_addr_list[0][3] & 0x000000FF);
[解决办法]
VOID GetSystemInfo(
LPSYSTEM_INFO lpSystemInfo
);