get ip adress and display it on the desktop

cornelvis

Active member
Joined
Jul 15, 2005
Messages
30
Programming Experience
3-5
get ip adress and display it on the desktop [RESOLVED]

can anyone tell me how?
I have this code:

VB.NET:
Imports System.net
[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] ipEntry [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] IPHostEntry = Dns.GetHostByName(Environment.MachineName)
[/SIZE][SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] IpAddr [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] IPAddress() = ipEntry.AddressList
[/SIZE][SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] i [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Integer
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Me[/COLOR][/SIZE][SIZE=2].Label1.Text = IpAddr(0).ToString()
[/SIZE]
It displays the machine's ipdress to the label1, but I want it to display it on the Desktop background of the computer

Thanks in advance.

Greetzzz,

CornElvis
 
Last edited:
thanks man.

Very usefull, but can't we make a background.bmp from it so I can place is on the dektop and refresh the desktop and then it will appear?

Is this possible, just like bginfo of sysinternals?

Thanks for the input so far.
 
you could also set the form's border to none, and the label's background color to transparent then have the form size be the same as the label, be sure to use Bold in the font too

what this will do is make it so your form is invisible, and the background of the label invisible

with some code you can even make it so the form will move by clicking on the label, then you'd have movable text showing the ip on the desktop, you can also make it ontop of everything else too
 
you wouldnt have to, but say you gave a friend a copy of it; that friend would probably want to be able to move it

plus there will always be a rare occasion where it'd be in the way so knowing it's movable is kinda nice
you could also make a checked menu item to indicate if it's movable or not too

but no, you dont have to have it be movable, it's your program
 
Back
Top