Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

_GetIP() & _GetIPEx()


  • This topic is locked This topic is locked
23 replies to this topic

#1 guinness

guinness

    all-consuming swarm in inconspicuous disguise

  • Developers
  • 17,510 posts

Posted 27 December 2010 - 07:38 PM

IMPORTANT: Updated version of _GetIP()
This is another version of _GetIP() without having to write to a temporary file initially, plus it uses two new IP retrieval sites.

Included _GetIPEx() which Returns an Array with the details of IP Address, Country of origin and Country code. Any valid public IP Address can be passed through _GetIPEx() e.g. _GetIPEx(123.123.123.123) Also included _GetISP() which retrieves information about the ISP and information about the IP Address.

Function: _GetIP() Fixed.

AutoIt         
; #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 ; #FUNCTION# ========================================================================================================= ; Name...........: _GetIP ; Description ...: Retrieves the Public IP Address of a Network/Computer. ; Syntax.........: _GetIP() ; Parameters ....: None ; Requirement(s).: v3.3.2.0 or higher ; Return values .: Success - Returns Public IP Address. ;                  Failure - Returns -1 & sets @error = 1 ; Author ........: guinness ; Example........; Yes ;===================================================================================================================== Func _GetIP()     Local $aReturn, $bRead, $sRead     $bRead = InetRead("http://checkip.dyndns.org/")     $sRead = BinaryToString($bRead)     $aReturn = StringRegExp($sRead, '(?s)(?i)<body>Current IP Address: (.*?)</body>', 3)     If @error = 0 Then         Return $aReturn[0]     EndIf     $bRead = InetRead("http://automation.whatismyip.com/n09230945.asp") ; http://forum.whatismyip.com/f14/our-automation-rules-t241/     $sRead = BinaryToString($bRead)     If @error Then         Return SetError(1, 0, -1)     EndIf     Return $sRead EndFunc   ;==>_GetIP
Example use of Functions:

AutoIt         
#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #include <Array.au3> ; Not Required, Only Needed For _ArrayDisplay() Global $aArray MsgBox(0, "Public IP Address - _GetIP()", _GetIP()) ; Improved _GetIP() MsgBox(0, "Public IP Address - _GetIP_1()", _GetIP_1()) ; Alternative _GetIP() $aArray = _GetIPEx() _ArrayDisplay($aArray, "Public IP Address - _GetIPEx()") $aArray = _GetISP_1() _ArrayDisplay($aArray, "Public IP Address - _GetISP_1()") $aArray = _GetISP_2() _ArrayDisplay($aArray, "Public IP Address - _GetISP_2()") $aArray = _GetISP_3() _ArrayDisplay($aArray, "Public IP Address - _GetISP_3()") MsgBox(0, "Provider Name - _GetProvider()", _GetProvider()) ; #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 ; #FUNCTION# ========================================================================================================= ; Name...........: _GetIP ; Description ...: Retrieves the Public IP Address of a Network/Computer. ; Syntax.........: _GetIP() ; Parameters ....: None ; Requirement(s).: v3.3.2.0 or higher ; Return values .: Success - Returns Public IP Address. ;                  Failure - Returns -1 & sets @error = 1 ; Author ........: guinness ; Example........; Yes ;===================================================================================================================== Func _GetIP()     Local $aReturn, $bRead, $sRead     $bRead = InetRead("http://checkip.dyndns.org/")     $sRead = BinaryToString($bRead)     $aReturn = StringRegExp($sRead, '(?s)(?i)<body>Current IP Address: (.*?)</body>', 3)     If Not @error Then         Return $aReturn[0]     EndIf     $bRead = InetRead("http://www.whatismyip.com/automation/n09230945.asp") ; http://forum.whatismyip.com/f14/our-automation-rules-t241/     $sRead = BinaryToString($bRead)     If @error Then         Return SetError(1, 0, -1)     EndIf     Return $sRead EndFunc   ;==>_GetIP Func _GetIP_1()     Local $aReturn, $bRead, $sRead     $bRead = InetRead("http://api.hostip.info/?ip=")     $sRead = BinaryToString($bRead)     $aReturn = StringRegExp($sRead, "<ip>(.*?)</ip>", 3)     If @error Then         Return SetError(1, 0, -1)     EndIf     Return $aReturn[0] EndFunc   ;==>_GetIP_1 ; #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 ; #FUNCTION# ========================================================================================================= ; Name...........: _GetIPEx ; Description ...: Retrieves the Public IP Address of a Network/Computer with additional details. ; Syntax.........: _GetIPEx([$iIPAddress]) ; Parameters ....: $iIPAddress - [Optional] A valid IP Address e.g. 192.168.0.1 ; Requirement(s).: v3.3.2.0 or higher ; Return values .: Success - Returns a 1D Array. $Array[4] = [Number of Items, IP Address, Country name, Country code] ;                  Failure - Returns -1 & sets @error = 1 ; Author ........: guinness ; Example........; Yes ;===================================================================================================================== Func _GetIPEx($iIPAddress = "")     Local $aReturn, $aXML[4] = [3, "ip", "countryName", "countryAbbrev"], $bRead, $sRead     $bRead = InetRead("http://api.hostip.info/?ip=" & $iIPAddress)     If @error Then         Return SetError(1, 0, -1)     EndIf     $sRead = BinaryToString($bRead)     For $A = 1 To $aXML[0]         $aReturn = StringRegExp($sRead, "<(?i)" & $aXML[$A] & ">(.*?)</(?i)" & $aXML[$A] & ">", 3)         $aXML[$A] = $aReturn[0]     Next     If @error Then         Return SetError(1, 0, -1)     EndIf     Return $aXML EndFunc   ;==>_GetIPEx ; #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 ; #FUNCTION# ========================================================================================================= ; Name...........: _GetISP ; Description ...: Retrieves the Public IP Address of a Network/Computer with additional details. ; Syntax.........: _GetISP([$iIPAddress]) ; Parameters ....: $iIPAddress - [Optional] A valid IP Address e.g. 192.168.0.1 ; Requirement(s).: v3.3.2.0 or higher ; Return values .: Success - Returns a 1D Array. $Array[9] = [Number of Items, IP Address, ISP, ISP location, Country, IPv4 Dotted Binary Notation, _ ;                  IPv4 Dotted Octal Notation, IPv4 Dotted Decimal Notation, IPv4 Dotted Hexadecimal Notation] ;                  Failure - Returns -1 & sets @error = 1 ; Author ........: guinness ; Example........; Yes ;===================================================================================================================== Func _GetISP_1($iIPAddress = "")     Local $aReturn, $aXML[9] = [8, "ipspan", "networkspan", "addressspan", "countryspan", "ipbinaryspan", "ipoctalspan", "ipdecimalspan", "iphexadecimalspan"], $bRead, $sRead     $bRead = InetRead("http://www.ip-details.com/ip-search/" & $iIPAddress)     If @error Then         Return SetError(1, 0, -1)     EndIf     $sRead = BinaryToString($bRead)     $aReturn = StringRegExp($sRead, '(?s)(?i)<!-- start content -->(.*?)<!-- end content -->', 3)     $sRead = $aReturn[0]     For $A = 1 To $aXML[0]         $aReturn = StringRegExp($sRead, '(?i)<span id="' & $aXML[$A] & '">(.*?)</span>', 3)         If @error Then             ContinueLoop         EndIf         $aXML[$A] = $aReturn[0]     Next     If @error Then         Return SetError(1, 0, -1)     EndIf     Return $aXML EndFunc   ;==>_GetISP_1 ; #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 ; #FUNCTION# ========================================================================================================= ; Name...........: _GetISP ; Description ...: Retrieves the Public IP Address of a Network/Computer with additional details. ; Syntax.........: _GetISP() ; Requirement(s).: v3.3.2.0 or higher ; Return values .: Success - Returns a 1D Array. $Array[5] = [Number of Items, IP Address, Country name, Host Name, ISP] ;                  Failure - Returns -1 & sets @error = 1 ; Author ........: guinness ; Example........; Yes ;===================================================================================================================== Func _GetISP_2()     Local $aReturn, $aXML[5] = [4], $bRead, $sRead     $bRead = InetRead("http://ip.xxoo.net/")     $sRead = BinaryToString($bRead)     $aReturn = StringRegExp($sRead, '(?s)(?i)<B>IP Address:</B>(.*?)<script type="text/javascript">', 3)     If @error Then         Return SetError(1, 0, -1)     EndIf     $sRead = $aReturn[0]     $aReturn = StringRegExp($sRead, '(?s)(?i)<div align="left">(.*?)</div>', 3)     If @error Then         Return SetError(1, 0, -1)     EndIf     $sRead = $aReturn     For $A = 1 To $aXML[0]         If $A - 1 = 1 Then             $aReturn = StringRegExp($sRead[$A - 1], '(?s)(?i)\A(.*?) ', 3)             If @error Then                 ContinueLoop             EndIf             $sRead[$A - 1] = $aReturn[0]         EndIf         $aXML[$A] = $sRead[$A - 1]     Next     If @error Then         Return SetError(1, 0, -1)     EndIf     Return $aXML EndFunc   ;==>_GetISP_2 ; #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 ; #FUNCTION# ========================================================================================================= ; Name...........: _GetISP ; Description ...: Retrieves the Public IP Address of a Network/Computer with additional details. ; Syntax.........: _GetISP() ; Requirement(s).: v3.3.2.0 or higher ; Return values .: Success - Returns a 1D Array. $Array[10] = [Number of Items, IP Address, AS number, ASN number, ISP name, ISP address, Net address, ISP description, City, Country] ;                  Failure - Returns -1 & sets @error = 1 ; Author ........: guinness ; Example........; Yes ;===================================================================================================================== Func _GetISP_3()     Local $aReturn, $aXML[10] = [9, "ip", "as", "asn", "asname", "ptr", "net", "netdescr", "city", "country"], $bRead, $sRead     $bRead = InetRead("http://www.robtex.com/ipinfo.js")     $sRead = BinaryToString($bRead)     For $A = 1 To $aXML[0]         $aReturn = StringRegExp($sRead, '(?s)(?i)if\(m=="' & $aXML[$A] & '"\) a\.innerHTML="(.*?)"', 3)         If @error Then             ContinueLoop         EndIf         $aXML[$A] = $aReturn[0]     Next     If @error Then         Return SetError(1, 0, -1)     EndIf     Return $aXML EndFunc   ;==>_GetISP_3 ; #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 ; #FUNCTION# ========================================================================================================= ; Name...........: _GetProvider ; Description ...: Retrieves the ISP provider name. ; Syntax.........: _GetProvider() ; Parameters ....: None ; Requirement(s).: v3.3.2.0 or higher ; Return values .: Success - Returns ISP provider name. ;                  Failure - Returns -1 & sets @error = 1 ; Author ........: guinness ; Example........; Yes ;===================================================================================================================== Func _GetProvider()     Local $aReturn, $bRead, $sRead     $bRead = InetRead("http://www.robtex.com/ipinfo.js")     $sRead = BinaryToString($bRead)     $aReturn = StringRegExp($sRead, '(?s)(?i)if\(m=="asname"\) a\.innerHTML="(.*?)"', 3)     If @error Then         Return SetError(1, 0, -1)     EndIf     Return $aReturn[0] EndFunc   ;==>_GetProvider

IPChicken Example:

AutoIt         
ConsoleWrite(_GetIP_Chicken() & @CRLF) ; #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 ; #FUNCTION# ========================================================================================================= ; Name...........: _GetIP_Chicken ; Description ...: Retrieves the Public IP Address of a Network/Computer. ; Syntax.........: _GetIP_Chicken() ; Parameters ....: None ; Requirement(s).: v3.3.2.0 or higher ; Return values .: Success - Returns Public IP Address. ;                  Failure - Returns -1 & sets @error = 1 ; Author ........: guinness ; Example........; Yes ;===================================================================================================================== Func _GetIP_Chicken()     Local $aReturn, $bRead, $sRead     $bRead = InetRead("http://www.ipchicken.com/")     $sRead = BinaryToString($bRead)     $aReturn = StringRegExp($sRead, '(?s)(?i)<b>(.*?)<br>', 3)     If @error Then         Return SetError(1, 0, -1)     EndIf     Return StringStripWS($aReturn[0], 8) EndFunc   ;==>_GetIP_Chicken

Additional _GetIP() Functions can be found at the following locations >>
1. http://www.autoitscript.com/forum/topic/123641-getip-getipex/page__view__findpost__p__870575
2. http://www.autoitscript.com/forum/topic/123641-getip-getipex/page__view__findpost__p__871938
3. http://www.autoitscript.com/forum/topic/123641-getip-getipex/page__view__findpost__p__880903

Note: I have tried to stay within the policies set out by the individual website owners, but if I have missed something then please let me know!

All functions (apart from _GetIP in this post) are deprecated.

Edited by guinness, 20 May 2013 - 11:15 PM.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()LockFile()Mapping CtrlIDsParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...
Updated: 26/09/2014








#2 mesale0077

mesale0077

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 477 posts

Posted 28 December 2010 - 10:46 AM

hi
nice cool
but
ISP info
how add ISP info
thank you

#3 guinness

guinness

    all-consuming swarm in inconspicuous disguise

  • Developers
  • 17,510 posts

Posted 28 December 2010 - 11:06 AM

The question is a little vague about what details you want? Does this site offer the info you want >> http://www.ip-details.com/ If so then it's easy to code.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()LockFile()Mapping CtrlIDsParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...
Updated: 26/09/2014


#4 guinness

guinness

    all-consuming swarm in inconspicuous disguise

  • Developers
  • 17,510 posts

Posted 28 December 2010 - 05:40 PM

@mesale0077 I have updated the OP and add _GetISP() & improved the additional Functions.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()LockFile()Mapping CtrlIDsParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...
Updated: 26/09/2014


#5 guinness

guinness

    all-consuming swarm in inconspicuous disguise

  • Developers
  • 17,510 posts

Posted 28 December 2010 - 05:49 PM

WARNING: Removed due to being included in AutoIt v3.3.10.0+

Edited by guinness, 28 February 2014 - 08:30 PM.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()LockFile()Mapping CtrlIDsParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...
Updated: 26/09/2014


#6 mesale0077

mesale0077

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 477 posts

Posted 28 December 2010 - 08:49 PM

hi
thank you "guinness"
but
look this link
http://ip.xxoo.net/
or
this nice site :
http://www.tracemyip.org/

info ısp or Provider ,
ı need ISP
but I could not find
I want to use for a long time a site

Edited by mesale0077, 28 December 2010 - 09:03 PM.


#7 guinness

guinness

    all-consuming swarm in inconspicuous disguise

  • Developers
  • 17,510 posts

Posted 28 December 2010 - 09:29 PM

I only grab the information that is contained on the sites I have provided and _GetISP() shows the ISP (+ more) as it takes the information directly from the website.

Plus, http://www.tracemyip.org/ is listed here >> http://hosts-file.net/default.asp?s=http%3A%2F%2Fwww.tracemyip.org%2F therefore I won't be adding it!

I have created another _GetISP() for you using the website - http://ip.xxoo.net/
AutoIt         
#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #include <Array.au3> ; Not Required, Only Needed For _ArrayDisplay() Global $aArray = _GetISP() _ArrayDisplay($aArray, "Public IP Address") ; #FUNCTION# ========================================================================================================= ; Name...........: _GetISP ; Description ...: Retrieves the Public IP Address of a Network/Computer with additional details. ; Syntax.........: _GetISP() ; Requirement(s).: v3.3.2.0 or higher ; Return values .: Success - Returns a 1D Array. $Array[5] = [Number of Items, IP Address, Country name, Host Name, ISP] ;                  Failure - Returns -1 & sets @error = 1 ; Author ........: guinness ; Example........; Yes ;===================================================================================================================== Func _GetISP()     Local $aXML[5] = [4]     Local $bRead, $sRead, $sReturn     $bRead = InetRead("http://ip.xxoo.net/")     $sRead = BinaryToString($bRead)     $sReturn = StringRegExp($sRead, '(?s)(?i)<B>IP Address:</B>(.*?)<script type="text/javascript">', 3)     If @error Then Return SetError(1, 1, -1)     $sRead = $sReturn[0]     $sReturn = StringRegExp($sRead, '(?s)(?i)<div align="left">(.*?)</div>', 3)     If @error Then Return SetError(1, 1, -1)     $sRead = $sReturn     For $A = 1 To $aXML[0]         If $A - 1 = 1 Then             $sReturn = StringRegExp($sRead[$A - 1], '(?s)(?i)\A(.*?)&nbsp;', 3)             If @error Then ContinueLoop             $sRead[$A - 1] = $sReturn[0]         EndIf         $aXML[$A] = $sRead[$A - 1]     Next     If Not @error Then Return $aXML     Return SetError(1, 1, -1) EndFunc   ;==>_GetISP

Note: Updated OP.

Edited by guinness, 17 May 2011 - 08:07 PM.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()LockFile()Mapping CtrlIDsParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...
Updated: 26/09/2014


#8 mesale0077

mesale0077

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 477 posts

Posted 28 December 2010 - 09:41 PM

hi
very thank you
work :x
and
other
html write code
-----------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body><table class="t">
<tr><td>ip</td><td><a href="http://www.robtex.com/ipinfo.ip.html">ip</a></td></tr>
<tr><td>asname</td><td><a href="http://www.robtex.com/ipinfo.asname.html">asname</a></td></tr>
<tr><td>net</td><td><a href="http://www.robtex.com/ipinfo.net.html">net</a></td></tr>
<tr><td>netdescr</td><td><a href="http://www.robtex.com/ipinfo.netdescr.html">netdescr</a></td></tr>
<tr><td>country</td><td><a href="http://www.robtex.com/ipinfo.country.html">country</a></td></tr>
</table>

<script type="text/javascript" src="http://www.robtex.com/ipinfo.js"></script>
</body>
</html>
------------

Edited by mesale0077, 28 December 2010 - 09:53 PM.


#9 mesale0077

mesale0077

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 477 posts

Posted 29 December 2010 - 12:16 AM

hi
thank you

Edited by mesale0077, 29 December 2010 - 12:18 AM.


#10 guinness

guinness

    all-consuming swarm in inconspicuous disguise

  • Developers
  • 17,510 posts

Posted 29 December 2010 - 09:42 AM

Cheers for this example >> http://www.robtex.com/ipinfo.js but the data it provides is already located in the other functions I have created. :x Maybe you could give it a go, just you _GetIP() as a template.

Edited by guinness, 29 December 2010 - 09:42 AM.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()LockFile()Mapping CtrlIDsParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...
Updated: 26/09/2014


#11 mesale0077

mesale0077

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 477 posts

Posted 29 December 2010 - 05:29 PM

hi
thank you
dont read line 14

msgbox(0,"",_GetIsP()) Func _GetIsP()     Local $bRead, $sRead, $sReturn     $bRead = InetRead("<a href='http://www.robtex.com/ipinfo.js' class='bbc_url' title='External link' rel='nofollow external'>http://www.robtex.com/ipinfo.js"</a>)     $sRead = BinaryToString($bRead)     $sReturn = StringRegExp($sRead, '(?i)if(m=="asname") a.innerHTML="(.*?)\', 3) ;dont read line 14     If Not @error Then Return $sReturn[0] endfunc

Edited by mesale0077, 29 December 2010 - 05:33 PM.


#12 shai

shai

    Wayfarer

  • Active Members
  • Pip
  • 97 posts

Posted 29 December 2010 - 06:11 PM

hi
thank you
dont read line 14

msgbox(0,"",_GetIsP()) Func _GetIsP()     Local $bRead, $sRead, $sReturn     $bRead = InetRead("<a href='http://www.robtex.com/ipinfo.js' class='bbc_url' title='External link' rel='nofollow external'>http://www.robtex.com/ipinfo.js"</a>)     $sRead = BinaryToString($bRead)     $sReturn = StringRegExp($sRead, '(?i)if(m=="asname") a.innerHTML="(.*?)\', 3) ;dont read line 14     If Not @error Then Return $sReturn[0] endfunc

its not work for me.

this code work:
#Include <String.au3> msgbox(0,"",_GetIsP()) Func _GetIsP()     Local $bRead, $sRead, $sReturn     $bRead = InetRead("<a href='http://www.robtex.com/ipinfo.js' class='bbc_url' title='External link' rel='nofollow external'>http://www.robtex.com/ipinfo.js"</a>)     $sRead = BinaryToString($bRead)     $sReturn = _StringBetween($sRead, 'if(m=="asname") a.innerHTML="', '"')     If Not @error Then Return $sReturn[0] endfunc


#13 mesale0077

mesale0077

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 477 posts

Posted 29 December 2010 - 06:19 PM

hi
nice
thank you
worked

#14 schuc

schuc

    Wayfarer

  • Active Members
  • Pip
  • 52 posts

Posted 30 December 2010 - 05:59 PM

I only grab the information that is contained on the sites I have provided and _GetISP() shows the ISP (+ more) as it takes the information directly from the website.

Plus, http://www.tracemyip.org/ is listed here >> http://hosts-file.net/default.asp?s=http%3A%2F%2Fwww.tracemyip.org%2F therefore I won't be adding it!

I have created another _GetISP() for you using the website - http://ip.xxoo.net/

Note: Updated OP.


Thanks guinness. Getting ISP information is just what I needed!

#15 guinness

guinness

    all-consuming swarm in inconspicuous disguise

  • Developers
  • 17,510 posts

Posted 30 December 2010 - 06:58 PM

You're welcome schuc. Also I created an improved version of the _GetIP() in Inet.au3 UDF >> http://www.autoitscript.com/forum/topic/123641-getip-getipex/page__view__findpost__p__858868

Edited by guinness, 30 December 2010 - 07:02 PM.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()LockFile()Mapping CtrlIDsParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...
Updated: 26/09/2014


#16 guinness

guinness

    all-consuming swarm in inconspicuous disguise

  • Developers
  • 17,510 posts

Posted 02 January 2011 - 01:45 PM

mesale0077 - I felt a little guilty not converting your example here to another _GetISP() so I created this, and unlike shai's example this doesn't require any includes.

Note: Updated OP.

AutoIt         
; #FUNCTION# ========================================================================================================= ; Name...........: _GetISP ; Description ...: Retrieves the Public IP Address of a Network/Computer with additional details. ; Syntax.........: _GetISP() ; Requirement(s).: v3.3.2.0 or higher ; Return values .: Success - Returns a 1D Array. $Array[10] = [Number of Items, IP Address, AS number, ASN number, ISP name, ISP address, Net address, ISP description, City, Country] ;                  Failure - Returns -1 & sets @error = 1 ; Author ........: guinness ; Example........; Yes ;===================================================================================================================== Func _GetISP()     Local $aXML[10] = [9, "ip", "as", "asn", "asname", "ptr", "net", "netdescr", "city", "country"], $bRead, $sRead, $sReturn     $bRead = InetRead("http://www.robtex.com/ipinfo.js")     $sRead = BinaryToString($bRead)     For $A = 1 To $aXML[0]         $sReturn = StringRegExp($sRead, '(?s)(?i)if\(m=="' & $aXML[$A] & '"\) a\.innerHTML="(.*?)"', 3)         If @error Then ContinueLoop         $aXML[$A] = $sReturn[0]     Next     If Not @error Then Return $aXML     Return SetError(1, 1, -1) EndFunc   ;==>_GetISP


Shai's Example without _StringBetween()
; #FUNCTION# ========================================================================================================= ; Name...........: _GetProvider ; Description ...: Retrieves the ISP provider name. ; Syntax.........: _GetProvider() ; Parameters ....: None ; Requirement(s).: v3.3.2.0 or higher ; Return values .: Success - Returns ISP provider name. ;                  Failure - Returns -1 & sets @error = 1 ; Author ........: guinness ; Example........; Yes ;===================================================================================================================== Func _GetProvider()     Local $bRead, $sRead, $sReturn     $bRead = InetRead("http://www.robtex.com/ipinfo.js")     $sRead = BinaryToString($bRead)     $sReturn = StringRegExp($sRead, '(?s)(?i)if\(m=="asname"\) a\.innerHTML="(.*?)"', 3)     If Not @error Then Return $sReturn[0]     Return SetError(1, 1, -1) EndFunc   ;==>_GetProvider

Edited by guinness, 02 January 2011 - 01:51 PM.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()LockFile()Mapping CtrlIDsParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...
Updated: 26/09/2014


#17 mesale0077

mesale0077

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 477 posts

Posted 02 January 2011 - 04:08 PM

hi
thank you guinness
your this code worked

AutoIt         
#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #include <Array.au3> ; Required only for _ArrayDisplay(), but not the UDF's MsgBox(0, "Public IP Address - _GetIP()", _GetIP()) ; Improved _GetIP() MsgBox(0, "Public IP Address - _GetIP_New()", _GetIP_New()) ; Alternative _GetIP() Global $Array = _GetIPEx() _ArrayDisplay($Array, "Public IP Address - _GetIPEx()") $Array = _GetISP() _ArrayDisplay($Array, "Public IP Address - _GetISP()") $Array = _GetISP_New() _ArrayDisplay($Array, "Public IP Address - _GetISP_New()") $Array = _GetISP_New_() _ArrayDisplay($Array, "Public IP Address - _GetISP_New_()") MsgBox(0, "Provider Name - _GetProvider()", _GetProvider()) ; #FUNCTION# ========================================================================================================= ; Name...........: _GetIP ; Description ...: Retrieves the Public IP Address of a Network/Computer. ; Syntax.........: _GetIP() ; Parameters ....: None ; Requirement(s).: v3.3.2.0 or higher ; Return values .: Success - Returns Public IP Address. ;                  Failure - Returns -1 & sets @error = 1 ; Author ........: guinness ; Example........; Yes ;===================================================================================================================== Func _GetIP()     Local $bRead, $sRead, $sReturn     $bRead = InetRead("<a href='http://checkip.dyndns.org/' class='bbc_url' title='External link' rel='nofollow external'>http://checkip.dyndns.org/"</a>)     $sRead = BinaryToString($bRead)     $sReturn = StringRegExp($sRead, '(?s)(?i)<body>Current IP Address: (.*?)</body>', 3)     If Not @error Then Return $sReturn[0]     $bRead = InetRead("<a href='http://www.whatismyip.com/automation/n09230945.asp' class='bbc_url' title='External link' rel='nofollow external'>http://www.whatismyip.com/automation/n09230945.asp"</a>) ; <a href='http://forum.whatismyip.com/f14/our-automation-rules-t241/' class='bbc_url' title='External link' rel='nofollow external'>http://forum.whatismyip.com/f14/our-automation-rules-t241/</a>     $sRead = BinaryToString($bRead)     If Not @error Then Return $sRead     Return SetError(1, 1, -1) EndFunc   ;==>_GetIP ; #FUNCTION# ========================================================================================================= ; Name...........: _GetIP ; Description ...: Retrieves the Public IP Address of a Network/Computer. ; Syntax.........: _GetIP() ; Parameters ....: None ; Requirement(s).: v3.3.2.0 or higher ; Return values .: Success - Returns Public IP Address. ;                  Failure - Returns -1 & sets @error = 1 ; Author ........: guinness ; Example........; Yes ;===================================================================================================================== Func _GetIP_New()     Local $bRead, $sRead, $sReturn     $bRead = InetRead("<a href='http://api.hostip.info/?ip=' class='bbc_url' title='External link' rel='nofollow external'>http://api.hostip.info/?ip="</a>)     $sRead = BinaryToString($bRead)     $sReturn = StringRegExp($sRead, "<ip>(.*?)</ip>", 3)     If Not @error Then Return $sReturn[0]     $bRead = InetRead("<a href='http://www.checkingtools.com/ip_check' class='bbc_url' title='External link' rel='nofollow external'>http://www.checkingtools.com/ip_check"</a>)     $sRead = BinaryToString($bRead)     $sReturn = StringRegExp($sRead, '(?s)(?i)<a href="/\?ip=(.*?)">', 3)     If Not @error Then Return $sReturn[0]     Return SetError(1, 1, -1) EndFunc   ;==>_GetIP_New ; #FUNCTION# ========================================================================================================= ; Name...........: _GetIPEx ; Description ...: Retrieves the Public IP Address of a Network/Computer with additional details. ; Syntax.........: _GetIPEx([$sIPAddress]) ; Parameters ....: $sIPAddress - [Optional] A valid IP Address e.g. 192.168.0.1 ; Requirement(s).: v3.3.2.0 or higher ; Return values .: Success - Returns a 1D Array. $Array[4] = [Number of Items, IP Address, Country name, Country code] ;                  Failure - Returns -1 & sets @error = 1 ; Author ........: guinness ; Example........; Yes ;===================================================================================================================== Func _GetIPEx($sIPAddress = "")     Local $aXML[4] = [3, "ip", "countryName", "countryAbbrev"], $bRead, $sRead, $sReturn     $bRead = InetRead("<a href='http://api.hostip.info/?ip=' class='bbc_url' title='External link' rel='nofollow external'>http://api.hostip.info/?ip="</a> & $sIPAddress)     If @error Then Return SetError(1, 1, -1)     $sRead = BinaryToString($bRead)     For $A = 1 To $aXML[0]         $sReturn = StringRegExp($sRead, "<(?i)" & $aXML[$A] & ">(.*?)</(?i)" & $aXML[$A] & ">", 3)         $aXML[$A] = $sReturn[0]     Next     If Not @error Then Return $aXML     Return SetError(1, 1, -1) EndFunc   ;==>_GetIPEx ; #FUNCTION# ========================================================================================================= ; Name...........: _GetISP ; Description ...: Retrieves the Public IP Address of a Network/Computer with additional details. ; Syntax.........: _GetISP([$sIPAddress]) ; Parameters ....: $sIPAddress - [Optional] A valid IP Address e.g. 192.168.0.1 ; Requirement(s).: v3.3.2.0 or higher ; Return values .: Success - Returns a 1D Array. $Array[9] = [Number of Items, IP Address, ISP, ISP location, Country, IPv4 Dotted Binary Notation, _ ;                  IPv4 Dotted Octal Notation, IPv4 Dotted Decimal Notation, IPv4 Dotted Hexadecimal Notation] ;                  Failure - Returns -1 & sets @error = 1 ; Author ........: guinness ; Example........; Yes ;===================================================================================================================== Func _GetISP($sIPAddress = "")     Local $aXML[9] = [8, "ipspan", "networkspan", "addressspan", "countryspan", "ipbinaryspan", "ipoctalspan", "ipdecimalspan", "iphexadecimalspan"], $bRead, $sRead, $sReturn     $bRead = InetRead("<a href='http://www.ip-details.com/ip-search/' class='bbc_url' title='External link' rel='nofollow external'>http://www.ip-details.com/ip-search/"</a> & $sIPAddress)     If @error Then Return SetError(1, 1, -1)     $sRead = BinaryToString($bRead)     $sReturn = StringRegExp($sRead, '(?s)(?i)<!-- start content -->(.*?)<!-- end content -->', 3)     $sRead = $sReturn[0]     For $A = 1 To $aXML[0]         $sReturn = StringRegExp($sRead, '(?i)<span id="' & $aXML[$A] & '">(.*?)</span>', 3)         If @error Then ContinueLoop         $aXML[$A] = $sReturn[0]     Next     If Not @error Then Return $aXML     Return SetError(1, 1, -1) EndFunc   ;==>_GetISP ; #FUNCTION# ========================================================================================================= ; Name...........: _GetISP ; Description ...: Retrieves the Public IP Address of a Network/Computer with additional details. ; Syntax.........: _GetISP() ; Requirement(s).: v3.3.2.0 or higher ; Return values .: Success - Returns a 1D Array. $Array[5] = [Number of Items, IP Address, Country name, Host Name, ISP] ;                  Failure - Returns -1 & sets @error = 1 ; Author ........: guinness ; Example........; Yes ;===================================================================================================================== Func _GetISP_New()     Local $aXML[5] = [4]     Local $bRead, $sRead, $sReturn     $bRead = InetRead("<a href='http://ip.xxoo.net/' class='bbc_url' title='External link' rel='nofollow external'>http://ip.xxoo.net/"</a>)     $sRead = BinaryToString($bRead)     $sReturn = StringRegExp($sRead, '(?s)(?i)<B>IP Address:</B>(.*?)<script type="text/javascript">', 3)     If @error Then Return SetError(1, 1, -1)     $sRead = $sReturn[0]     $sReturn = StringRegExp($sRead, '(?s)(?i)<div align="left">(.*?)</div>', 3)     If @error Then Return SetError(1, 1, -1)     $sRead = $sReturn     For $A = 1 To $aXML[0]         If $A - 1 = 1 Then             $sReturn = StringRegExp($sRead[$A - 1], '(?s)(?i)\A(.*?)&nbsp;', 3)             If @error Then ContinueLoop             $sRead[$A - 1] = $sReturn[0]         EndIf         $aXML[$A] = $sRead[$A - 1]     Next     If Not @error Then Return $aXML     Return SetError(1, 1, -1) EndFunc   ;==>_GetISP_New ; #FUNCTION# ========================================================================================================= ; Name...........: _GetISP ; Description ...: Retrieves the Public IP Address of a Network/Computer with additional details. ; Syntax.........: _GetISP() ; Requirement(s).: v3.3.2.0 or higher ; Return values .: Success - Returns a 1D Array. $Array[10] = [Number of Items, IP Address, AS number, ASN number, ISP name, ISP address, Net address, ISP description, City, Country] ;                  Failure - Returns -1 & sets @error = 1 ; Author ........: guinness ; Example........; Yes ;===================================================================================================================== Func _GetISP_New_()     Local $aXML[10] = [9, "ip", "as", "asn", "asname", "ptr", "net", "netdescr", "city", "country"], $bRead, $sRead, $sReturn     $bRead = InetRead("<a href='http://www.robtex.com/ipinfo.js' class='bbc_url' title='External link' rel='nofollow external'>http://www.robtex.com/ipinfo.js"</a>)     $sRead = BinaryToString($bRead)     For $A = 1 To $aXML[0]         $sReturn = StringRegExp($sRead, '(?s)(?i)if\(m=="' & $aXML[$A] & '"\) a\.innerHTML="(.*?)"', 3)         If @error Then ContinueLoop         $aXML[$A] = $sReturn[0]     Next     If Not @error Then Return $aXML     Return SetError(1, 1, -1) EndFunc   ;==>_GetISP_New_ ; #FUNCTION# ========================================================================================================= ; Name...........: _GetProvider ; Description ...: Retrieves the ISP provider name. ; Syntax.........: _GetProvider() ; Parameters ....: None ; Requirement(s).: v3.3.2.0 or higher ; Return values .: Success - Returns ISP provider name. ;                  Failure - Returns -1 & sets @error = 1 ; Author ........: guinness ; Example........; Yes ;===================================================================================================================== Func _GetProvider()     Local $bRead, $sRead, $sReturn     $bRead = InetRead("<a href='http://www.robtex.com/ipinfo.js' class='bbc_url' title='External link' rel='nofollow external'>http://www.robtex.com/ipinfo.js"</a>)     $sRead = BinaryToString($bRead)     $sReturn = StringRegExp($sRead, '(?s)(?i)if\(m=="asname"\) a\.innerHTML="(.*?)"', 3)     If Not @error Then Return $sReturn[0]     Return SetError(1, 1, -1) EndFunc   ;==>_GetProvider

Edited by mesale0077, 02 January 2011 - 04:13 PM.


#18 guinness

guinness

    all-consuming swarm in inconspicuous disguise

  • Developers
  • 17,510 posts

Posted 05 January 2011 - 10:40 PM

Added OpenDNS IP Retrieval to OP.

Edited by guinness, 26 March 2011 - 10:24 PM.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()LockFile()Mapping CtrlIDsParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...
Updated: 26/09/2014


#19 guinness

guinness

    all-consuming swarm in inconspicuous disguise

  • Developers
  • 17,510 posts

Posted 25 January 2011 - 08:15 PM

Added IPChicken & CheckIP to OP.

Edited by guinness, 26 March 2011 - 10:24 PM.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()LockFile()Mapping CtrlIDsParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...
Updated: 26/09/2014


#20 CaptainClucks

CaptainClucks

    Unum Cavillator Spuria

  • Active Members
  • PipPipPipPipPipPip
  • 1,227 posts

Posted 26 January 2011 - 07:15 AM

Thanks for the hard work bro! not enough people mention this.
Spoiler

Warning: Posts by this user are subject to change or may disappear without notice.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users