VC获得Host的IP和名称
2008-07-07 21:44
309 查看
void GetIP() { char szHostName[128]; char szT[20]; if( gethostname(szHostName, 128) == 0 ) { // Get host adresses m_HostName.SetWindowText(szHostName); struct hostent * pHost; int i; pHost = gethostbyname(szHostName); for( i = 0; pHost!= NULL && pHost->h_addr_list[i]!= NULL; i++ ) { char str[100]; char addr[20]; int j; LPCSTR psz=inet_ntoa (*(struct in_addr *)pHost->h_addr_list[i]); m_IPAddr.AddString(psz); } } }
相关文章推荐
- 使用SQL语句获得服务器名称和IP 地址
- 获得本机外部IP和名称
- 使用SQL语句获得服务器名称和IP 地址
- 获得host 和 IP
- vc 获得调用者的模块名称
- 在VC中能不能获得被选中的文件的名称和路径(2008-10-30 11:32)
- kvm在host里获得guest的ip
- 获得本地计算机名称&获得本地IP
- VBNET编程获得计算机IP及名称
- VC++ 获得主机名与IP
- 获得本机IP和名称
- 获得局域网中IP和计算机名称
- java获得本机IP,名称等
- VBNET编程获得计算机IP及名称 (转载)
- C# 获得本机IP 和 电脑名称
- 获得本机IP和名称
- 获得ip和mac地址
- VC 获得当前应用程序所在路径(exe文件的路径)
- VC++环境下获取当前输入法名称
- 用C#获得计算机名称,IP地址,MAC地址以及CPU序列号