tsue Posted December 17, 2010 Share Posted December 17, 2010 hello, im trying to create a program to detect the global ip without having to go to the internet and ask for it, and the local ip address too, well i only know how to find the local ip via cmd ipconfig, but i have no idea how to import that command to my program and for the global ip, yust by going to the internet and ask for it in google can u please help me thanks. Link to comment Share on other sites More sharing options...
Fubarable Posted December 17, 2010 Share Posted December 17, 2010 (edited) If you search the AutoIt help files on the term IP Address, I think you'll find what you are looking for. Look for a function that starts with "get" and ends with "IP". I can't for the life of me imagine that this function works without going to the internet though to find the IP address. So I think that that part of your request will be hard if not impossible to implement. Edited December 17, 2010 by Fubarable Link to comment Share on other sites More sharing options...
C45Y Posted December 17, 2010 Share Posted December 17, 2010 If you search the AutoIt help files on the term IP Address, I think you'll find what you are looking for. Look for a function that starts with "get" and ends with "IP". I can't for the life of me imagine that this function works without going to the internet though to find the IP address. So I think that that part of your request will be hard if not impossible to implement._GetIp or something similar i believe it is called.and unfortunately it connects to the internet to get your 'global' or external ip.why would you not want to connect to the internet to find this information??? correct me if im wrong but i believe to have a external ip you must be connected to the internet, where a dhcp server will list you under one address or another http://twentylinesofcode.blogspot.comLittle apps n crap. can be fun Link to comment Share on other sites More sharing options...
CodyBarrett Posted December 17, 2010 Share Posted December 17, 2010 _GetIp or something similar i believe it is called.and unfortunately it connects to the internet to get your 'global' or external ip.why would you not want to connect to the internet to find this information??? correct me if im wrong but i believe to have a external ip you must be connected to the internet, where a dhcp server will list you under one address or anotheryou're right. the isp needs to have you listed as an IP in their IP-Pool, and if you don't have an internet connection, you don't have an external IP, BUT it is possible for you to have no internet connection and still have an INTERNAL Ip, which is usually private if you're on a network. [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
JohnOne Posted December 17, 2010 Share Posted December 17, 2010 My router, has the external/wan ip in it, so I suppose a lot do. You could most likely extract it with the _IE functions, or maybe even the native Inet functions. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
guinness Posted December 17, 2010 Share Posted December 17, 2010 (edited) It would be difficult especially considering the Router is probably password protected, so having your Username and Password embedded in the AutoIt EXE/AU3 might be considered a security risk to some. If you don't have an internal network then try using @IPAddress1 and see if this brings your External IP Address, it's the case for some people who live in student accommodation and connect directly to the network as they normally/sometimes broadcast your External IP Address. Otherwise _GetIP() is looking at the best option. I tried searching for a _WinAPI_() Function with no luck. @IPAddress1 shows the same IP as in ipconfig! Edited December 17, 2010 by guinness UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _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 parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
JohnOne Posted December 17, 2010 Share Posted December 17, 2010 Well it depends who the script is for, and if its a distributed on the pass and user can be simply stored locally in a txt file or something. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
tsue Posted December 17, 2010 Author Share Posted December 17, 2010 hello, thanks for the information, ill check it and about conecting to the internet im sorry for the missundertanding i was meaning not to connect to firefox then google then whats my ip then check in web pages to find it, so the program does that in an easy way or something thanks Link to comment Share on other sites More sharing options...
tsue Posted December 18, 2010 Author Share Posted December 18, 2010 Okay. The _GetIP function does not open any browser windows, and is much easier than trying to get the IP from your router. #include <Inet.au3> Global $PublicIP = _GetIP() MsgBox(0, "IP Address", "Your IP Address is: " & $PublicIP) this code is allways returning me a -1 wich it is an error i have everything ok im conected to the internet trought a router wile i check for the ip, i read it connects to a discovery ip site, but i dont know why is the error? Link to comment Share on other sites More sharing options...
guinness Posted December 18, 2010 Share Posted December 18, 2010 Slightly @OffTopic but => Download: and then use _WinAPI_IsInternetConnected() - Check the Internet is connected or _WinAPI_IsNetworkAlive() - Check you that you are connected to your Local Area Network. If you get 0 for _WinAPI_IsInternetConnected() then you are not connected to the Internet. I tried Deathbringer's Example and it returns the IP Address. Are you using a new Version of AutoIt? Have you updated your Windows (no idea of your version) in the last week? Sometimes I have experienced problems before and then once I have restarted voila not there anymore! UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _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 parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 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