Jump to content

global ip


tsue
 Share

Recommended Posts

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

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 by Fubarable
Link to comment
Share on other sites

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

_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

you'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.

Link to comment
Share on other sites

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. :x

@IPAddress1 shows the same IP as in ipconfig!

Edited 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 parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

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

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

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 parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...