我试了,支持PB11.5 VC++写的获取本机IP的动态库,并支持多个网卡。 若有多个网卡会用;号分隔开。调用定义 PB调用定义: Function uLong GetHostIpList(ref string hostAddressip) Library "GetIP60.dll" PB11.2调用定义: Function uLong GetHostIpList(ref string hostAddressip) Library "GetIP60.dll" ALIAS FOR "GetHostIpList;ansi" 调用方法 string ls_HostIP = space(128) if GetHostIpList(ls_HostIP) =0 then sle_1.text=trim(ls_HostIP) end if ========================================================== 获取主机名的API PB调用定义: Function uLong Gethost(ref string hostname) Library "GetIP60.dll" PB11.2调用定义: Functi on uLong Gethost(ref string hostname) Library "GetIP60.dll" ALIAS FOR "Gethost;ansi" 调用方法 string ls_Host = space(256) int result result = Gethost(ls_Host) if result =0 then sle_1.text=trim(ls_Host) end if