Sign in to follow this  
Followers 0
itlad

display IP address in a text box

5 posts in this topic

Hello folks,

I'd like to write a tiny script to display an informational window on the screen that shows the host's IP address.

I used autoit a couple of years ago and found it pretty handy. However,it's been a while since I could write some fun script using AutoIT again, and I can hardly take a minute to read the documentation from the top again just now.

If anyone would like to take a minute to show me what is the function to use or something, that would be much appreciated :D

Thanks very much.

Share this post


Link to post
Share on other sites



Hello folks,

I'd like to write a tiny script to display an informational window on the screen that shows the host's IP address.

I used autoit a couple of years ago and found it pretty handy. However,it's been a while since I could write some fun script using AutoIT again, and I can hardly take a minute to read the documentation from the top again just now.

If anyone would like to take a minute to show me what is the function to use or something, that would be much appreciated :D

Thanks very much.

Well maybe you'd better find that minute and look in the help under the section "User Defined Functions Reference".

Bloody cheek, use your own minutes up.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

well,

I had a look earlier but then the only thing I have found so far is the function TCPNameToIP. Thing is I am not supposed to know the hostname in the first place. Maybe I can provide the TCPNameToIP function with the windows %COMPUTERNAME% environment variable ? if so, is there a particular way to access Windows variables with AutoIT ?

Cheers

Share this post


Link to post
Share on other sites

You can use TCPNameToIP with the @ComputerName macro (same as %COMPUTERNAME%), but much easier is to use @IpAddress1 macro. Environment variables not already in macros can be accessed with EnvGet.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

If you want your external address use the Inet library (_GetIP)

If not then use @IpAddress1

Then use GuiCtrlSetData or ControlSetText to put this in your text box.

Edited by darkjohn20

Share this post


Link to post
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
Sign in to follow this  
Followers 0