Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get Client IP address 1

Status
Not open for further replies.

MotoP

Technical User
Jan 30, 2006
4
GB
Is there anyway to get the Client IP address ... the machine you are running Procomm from?
The Host IP address is easy $IPADDRESS, is there anything like this for the Client?
 
Unfortunately, it's not as easy to get as $IPADDRESS, but it's fairly doable with the below script:

proc main
string sLine, sIP

dos "ipconfig > c:\ip.txt"
pause 3
fopen 0 "c:\ip.txt" READ TEXT
while not feof 0
fgets 0 sLine
if strfind sLine "IP Address"
strextract sIP sLine ":" 1
strreplace sIP " " ""
strreplace sIP "`n" ""
strreplace sIP "`r" ""
endif
endwhile
fclose 0
delfile "c:\ip.txt"
endproc

 
Didn't think about piping to a text file ... you are a font of knowledge ;-)
Cheers Knob, keep up the great work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top