CIPADDRESSCTRL 获取本机IP
2011-12-01 12:42
288 查看
char name[255];//hostname CString ip;//ip string PHOSTENT hostinfo;//phostent struct if (gethostname(name,sizeof(name))==0)//hostname-->name { if ((hostinfo=gethostbyname(name))!=NULL)//hostinfo init { ip=inet_ntoa(*(struct in_addr*)*hostinfo->h_addr_list);//convert member variable h_addr_list(ip) into a string in dotted format GetDlgItem(IDC_IPADDRESS1)->SetWindowText(ip); } }
相关文章推荐
- IPAddressCtrl地址的获取和设置
- CIPAddressCtrl::SetAddress
- CIPAddressCtrl控件的用法
- CIPAddressCtrl的用法
- CIPAddressCtrl控件
- CIPAddressCtrl的用法
- Android 获取设备IP,已连接WiFi信息;(Android API-23: InetAddressUtils 替换)
- CIPAddressCtrl控件的用法
- CIPAddressCtrl 控件的使用
- CIPAddressCtrl
- CIPAddressCtrl IP控件
- CIPAddressCtrl(ip地址控件)使用学习只看楼主 收藏
- CIPAddressCtrl控件之IP地址与CString的互相转化
- CIPAddressCtrl的用法
- CIPAddressCtrl控件的用法
- CIPAddressCtrl的用法
- CIPAddressCtrl控件的用法
- CIPAddressCtrl控件的用法:
- InetAddress.getLocalHost().getHostAddress()获取的ip为127.0.0.1
- Returning an IPv4 Address in an IPv6-Enabled Environment 在vista中获取IPV4的IP