文件名称:getIP-impro
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:6.3kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
本程序用户获取主机的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
#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
(系统自动生成,下载前可以参看下载内容)
下载文件列表
getIP-impro/getIP
getIP-impro/getIP.c
getIP-impro/getIP.h
getIP-impro/getIP.o
getIP-impro/main.c
getIP-impro/main.o
getIP-impro/readme
getIP-impro/代码说明.txt
getIP-impro
getIP-impro/getIP.c
getIP-impro/getIP.h
getIP-impro/getIP.o
getIP-impro/main.c
getIP-impro/main.o
getIP-impro/readme
getIP-impro/代码说明.txt
getIP-impro
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.