Location:
Search - GetIp.h
Search list
Description: 域名解析。通过域名获得ip地址是不可多得的vc网络程序代码-Domain Name. Through Domain ip address is rare vc network code
Platform: |
Size: 29696 |
Author: 周东文 |
Hits:
Description: 本程序用户获取主机的IP地址和MAC地址,头文件与函数原型如下
#include "getIP.h"
int get_ip(char *ipaddr, char *netmask, const char *ethname)
#include "getIP.h"
int get_mac(char *mac)
以下是get_ip函数简单使用范例
//定义IP和MAC所需要的存储空间
char ethname[] = "eth0"
char ipaddr[20] //IP地址最长为16个字符
char netmask[20] //子网掩码最长为18个字符
//获取IP地址
get_ip(ipaddr,netmask,ethname)
//输出结果
printf(" s\n",ipaddr)
printf(" s\n",netmask)
以下是get_mac函数简单使用范例
-The program user access to the host' s IP address and MAC address, the following function prototype header file# include " getIP.h" int get_ip (char* ipaddr, char* netmask, const char* ethname) # include " getIP.h" int get_mac (char* mac) use the following simple example is get_ip function// define the IP and MAC need storage space char ethname [] = " eth0" char ipaddr [20] // IP address of up to 16 characters char netmask [20] // mask for up to 18 characters// Obtain an IP address get_ip (ipaddr, netmask, ethname) // output printf (" s \ n" , ipaddr) printf ( " s \ n" , netmask) use the following simple example is get_mac function
Platform: |
Size: 6144 |
Author: quietojlt |
Hits: