Prompting for an IP address

T

TyBreaker

Is there a built-in text box for obtaining IP addresses as in the way
Windows prompts for in the Network Config screens?
--
______ ___ __
/_ __/_ __/ _ )_______ ___ _/ /_____ ____
/ / / // / _ / __/ -_) _ `/ '_/ -_) __/
/_/ \_, /____/_/ \__/\_,_/_/\_\\__/_/
/___/

There are 10 types of people in this world; those who understand the
binary numbering system and those who don't.

There's no place like 127.0.0.1.

ASCII a silly question, get a silly ANSI.
 
G

Guest

There is none that i know of, however, you can just put a textbox for the
user to input the IP in, put a restriction on how many characters they can
input, then use the following code to parse it to an IPAddress object

2003:

Dim ip As IPAddress = DNS.Resolve(Me.TextBox1.Text).AddressList(0)

2005:

Dim ip As IPAddress = DNS.GetHostEntry(Me.TextBox1.Text).AddressList(0)


hope this helps
 
T

TyBreaker

Peter said:
In 2005 the MaskedTextbox is back, you could use that one.

Thanks, I've been playing with this control but can't get it to work as
one might expect e.g. I can use the mask "000.000.000.000" and this
allows an IP address which has 4 lots of 3 digits but it doesn't allow
you to enter any IP address which has less than 3 digits in any of its
sections e.g. 66.102.7.99 (Google). Any tips?

--
______ ___ __
/_ __/_ __/ _ )_______ ___ _/ /_____ ____
/ / / // / _ / __/ -_) _ `/ '_/ -_) __/
/_/ \_, /____/_/ \__/\_,_/_/\_\\__/_/
/___/

There are 10 types of people in this world; those who understand the
binary numbering system and those who don't.

There's no place like 127.0.0.1.

ASCII a silly question, get a silly ANSI.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

System Icons? 2
Form Layout 3
Dynamic buttons 2
Floating Menu Bar 6
VB.NET Appbar example? 1
VB2005: Controls not appearing on form 3
MouseMove event not firing 3
Appbar and Tooltips 1

Top