Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
addextender("wwint34i.dll") tophandle=iBegin(0,"","") connecthandle=iHostConnect(tophandle, "www.whatismyip.com", @HTTP, "", "") datahandle=iHttpInit(connecthandle, "GET", "/", "",0) if datahandle==0 err=iGetLastError() Message("Last Error",err) iClose(tophandle) exit endif ;Make sure to allocate large enough buffer to hold the entire file size=10000 buf=BinaryAlloc(size) ;Get address of buffer bufaddr=IntControl (42, buf, 0, 0, 0) BinaryEodSet(buf, size) rslt=iHttpOpen(datahandle, "", 0,0) if rslt=="ERROR" || rslt!=200 if rslt == "ERROR" errstr = "WinInet Error" rslt = iGetLastError() else errstr = "HTTP Error" endif Message(errstr,rslt) iClose(tophandle) exit endif strToLocate = "Your IP is " Start = strLen(StrToLocate) CharEnd = "<" iReadDataBuf(datahandle,bufaddr,size) str=BinaryPeekStr(buf, 0, size) LocateStart= StrIndex(str, strToLocate, 1, @fwdscan) + Start LocateEnd = strscan(str,CharEnd,LocateStart,@fwdscan) Length = LocateEnd - LocateStart IPADDRESS = strsub(str,LocateStart,Length) Message("The IP of this machine is",IPAddress) iClose(datahandle) iClose(tophandle) exit
Article ID: W16885
File Created: 2007:07:03:14:26:42
Last Updated: 2007:07:03:14:26:42