Edgar0024 Posted July 13, 2007 Share Posted July 13, 2007 I use InetGet ( "URL" [,"filename" [, reload [, background]]] ) for download source code index page site. I want know if exist function for get webpage using IP address instead that URL name ( www.xyz.com ) If i write IP ADDRESS in function InetGet same xxx.xx.xxx.xxx dont work. Many thanks Edgar from Bangkok Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted July 13, 2007 Moderators Share Posted July 13, 2007 (edited) $sInfo = _StringIPPTR('64.111.104.70') MsgBox(64, @error, $sInfo) Func _StringIPPTR($sIP, $nTypeOnly = 0) If Not StringRegExp($sIP, "(?:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.)){3}(?:(25[0-5]$|2[0-4]\d$|1\d{2}$|[1-9]\d$|\d$))") Then _ Return SetError(1, 0, 0);Not a valid ip string If $nTypeOnly Then Return 1 Local $sStringIP = _INetGetSource("http://www.dnsstuff.com/tools/ptr.ch?ip=" & $sIP) If @error Or StringInStr($sStringIP, 'Unknown Page, sorry') Then Return SetError(2, 0, 0);Either _InetGetSource failed or the link did If StringInStr($sStringIP, "No PTR records exist for " & $sIP) Then Return SetError(3, 0, 0);No PTR records found (Probably not a valid ip) Local $aSREIP = StringRegExp($sStringIP, "(?s)(?i)PTR\srecord:\s+Reports\s(.*?).\s\[", 1); If IsArray($aSREIP) Then Return $aSREIP[0];Returns the PTR Record ;Error 4 is just precautionary, if StringRegExp() fails, it's probably do to dnsstuff changing their output format Return SetError(4, 0, 0) EndFunchttp://www.autoitscript.com/forum/index.ph...c=39932&hl=Edit:change the sad.gif to colon parenthisis Edited July 13, 2007 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Skrip Posted July 13, 2007 Share Posted July 13, 2007 Smoke, just disable the smilies in the post options. Under the post box. And above the post icon. [left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left] Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now