Home All Groups Group Topic Archive Search About

Prompting for an IP address

Author
8 Oct 2006 9:07 PM
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.

Author
8 Oct 2006 9:57 PM
iwdu15
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
--
-iwdu15
Author
9 Oct 2006 7:19 AM
Peter Proost
In 2005 the MaskedTextbox  is back, you could use that one.

Greetz, Peter

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning. (Rich Cook)

Show quoteHide quote
"iwdu15" <jmmgoalsteratyahoodotcom> schreef in bericht
news:F569EFAD-01C1-4E89-8733-D2978820AADC@microsoft.com...
> 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
> --
> -iwdu15
Author
9 Oct 2006 12:17 PM
TyBreaker
Peter Proost wrote:
> 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.
Author
9 Oct 2006 2:23 PM
Peter Proost
Hi maybe this will help you:

http://groups.google.be/group/microsoft.public.dotnet.languages.vb/msg/3d7c2
40123fc8def

Greetz, Peter

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning. (Rich Cook)

Show quoteHide quote
"TyBreaker" <tybreakerNO@SPAMhotmail.com> schreef in bericht
news:#UZ6rz56GHA.4568@TK2MSFTNGP02.phx.gbl...
> Peter Proost wrote:
> > 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.