【文件属性】:
文件名称:MAC/网卡IP地址获取 Delphi程序.rar
文件大小:8KB
文件格式:RAR
更新时间:2022-07-30 03:39:49
Delphi源码-系统相关
Delphi获取电脑IP地址、MAC网卡物理地址、本机名称等,网络相关信息获取,基本的Delphi网络参数获取代码,高手请绕行吧。通过调用Api函数gethostname,gethostbyname,wsastartup,uses中加winsock,介绍wsadata,phostent,msdn,另外gethostaddress。
function NBGetAdapterAddress(a: integer): String;
a指定多个网卡适配器中的哪一个0,1,2...
NCB:TNCB; // Netbios control block file://NetBios控制块
ADAPTER : TADAPTERSTATUS; // Netbios adapter status//取网卡状态
LANAENUM : TLANAENUM; // Netbios lana
intIdx : Integer; // Temporary work value//临时变量
cRC : Char; // Netbios return code//NetBios返回值
strTemp : String; // Temporary string//临时变量
WSAstartup在使用gethostname,gethostbyname前,一定不要忘了初始化WS2_32.DLL。
【文件预览】:
codesc.net
----获取本机机器名、IP信息以及网卡的MAC地址()
--------Project2.res(876B)
--------Unit1.ddp(51B)
--------Unit1.dcu(7KB)
--------Unit1.dfm(2KB)
--------Project2.dpr(188B)
--------Unit1.pas(4KB)