Home > database >  Turn 12.5 pb how to obtain an IP address
Turn 12.5 pb how to obtain an IP address

Time:09-20

PB use PBWS32. DLL to obtain an IP address in 12.5 come out the result of inaccurate, tested in PB12.5 PBWS32. DLL gethost () returns the host name, rather than the IP, which can provide more detailed examples for reference,

CodePudding user response:

1. You can use the run command ipconfig - all & gt; C: \ 1. TXT and then from 1. TXT extract desired results


2. Can change the DLL using GetNet. DLL
//get the machine IP address
The Function string GetLocalIp () Library "GetNet. DLL" alias for "GetLocalIp; Ansi"

CodePudding user response:

12.5 the original brothers have? Give an address to download or cracked versions

CodePudding user response:

What I use is cracked versions

CodePudding user response:

Can you give a detailed example on the second floor

CodePudding user response:

Available internetresult and inet to open the web site http://www.ip138.com/and then get the IP can be parsed out

//this function need internetresult n_cst_internet

The integer li_f flen, li_rc
String ls_result, ls_ip

Inet linet_main
N_cst_internet luo_data
Linet_main=CREATE inet
Luo_data n_cst_internet=https://bbs.csdn.net/topics/CREATE
SetPointer (HourGlass!
Li_rc=linet_main. GetURL (" http://www.ip38.com ", luo_data)
SetPointer (Arrow!
Ls_result=luo_data. Is_data

Ls_ip=Mid (ls_result, Pos (ls_result, 'your native IP address:', 1) + 14, Pos (ls_result, '& amp; nbsp; & nbsp; From ', 1), Pos (ls_result, 'your native IP address:', 1) - 16)
Return the trim (ls_ip)
//
DESTROY luo_data
DESTROY linet_main

CodePudding user response:

Upstairs, if it is in the C/S mode to get the machine IP address?

CodePudding user response:

Winsock can realize
//


The function int WSAStartup (uint UIVersionRequested, ref s_WSAData lpWSAData) library "wsock32. DLL
"The function int WSACleanup () library "wsock32. DLL
"The function int WSAGetLastError () library "wsock32. DLL
"The function int gethostname (ref string name, int namelen) library "wsock32. DLL
"The function string GetHost (string lpszhost, ref blob lpszaddress) library "pbws32. DLL
"Method of use:
S_wsadata l_WSAData
String ls_HostName=space (128)
String ls_IpAddress
Int li_version=257
Blob {4} lb_hostaddress

IF wsastartup (li_version, l_WSAData)=0 THEN

IF gethostname (ls_HostName, len (ls_HostName)) & lt; 0 THEN
Messagebox (" GetHostName ", WSAGetLastError ())
The ELSE
GetHost (ls_HostName lb_HostAddress)
Ls_IpAddress=string (asc (string (blobmid (lb_HostAddress, 1, 1))), "000") + ", "
Ls_IpAddress +=string (asc (string (blobmid (lb_HostAddress, 2, 1))), "000") + ", "
Ls_IpAddress +=string (asc (string (blobmid (lb_HostAddress, 3, 1))), "000") + ", "
Ls_IpAddress +=string (asc (string (blobmid (lb_HostAddress, 4, 1))), "000")
END the IF
WSACleanup ()
The ELSE
Messagebox (" GetHostName ", WSAGetLastError ())
END the IF
Sle_6. Text=ls_hostname
Sle_7. Text=ls_ipaddress


Getnet. DLL can be achieved

CodePudding user response:

Which master gives some technology to help! First of all, thank you!

With pb9.0 computer name, local IP address, MAC address, under the pb11.5 and 12.5, all failed,,,,,,,,,

CodePudding user response:

http://zhidao.baidu.com/question/392210222.html
Create a stored procedure and direct call

CodePudding user response:



If even the oracle database, oracle can do, a function of the problem, is quite simple

CodePudding user response:

reference 1st floor lzp_lrp response:
1. You can use the run command ipconfig - all & gt; C: \ 1. TXT and then from 1. TXT extract desired results


2. Can change the DLL using GetNet. DLL
//get the machine IP address
The Function string GetLocalIp () Library "GetNet. DLL" alias for "GetLocalIp; Ansi "

This was the LAN IP? IP networks outside not

CodePudding user response:

reference 5 floor herolion2010 reply:
available internetresult and inet to open the web site http://www.ip138.com/and then get the IP can be parsed out

//this function need internetresult n_cst_internet

The integer li_f flen, li_rc
String ls_result, ls_ip

Inet linet_main
N_cst_internet luo_data
Linet_main=CREATE inet
Luo_data n_cst_internet=https://bbs.csdn.net/topics/CREATE
SetPointer (HourGlass!
Li_rc=linet_main. GetURL (" http://www.ip38.com ", luo_data)
SetPointer (Arrow!
Ls_result=luo_data. Is_data

Ls_ip=Mid (ls_result, Pos (ls_result, 'your native IP address:', 1) + 14, Pos (ls_result, '& amp; nbsp; & nbsp; From ', 1), Pos (ls_result, 'your native IP address:', 1) - 16)
Return the trim (ls_ip)
//
DESTROY luo_data
DESTROY linet_main


Excuse me the inside of the ls_result=luo_data. Is_data is_data is how definition???????
  • Related