IP validation
Page 1 of 1
IP validation
#2
Re: IP validation
Posted 15 October 2008 - 07:46 AM
Sorry, do you want to check that the IP address is valid (what I would think IP Validation means) or whether you have a connection to a specific IP?
For the first, splitting on the dots and then checking that the results are 4 integers >= 0 and <= 255.
For the later, it would really depend on what the rest of your code is doing. How is it initiating the connection? What type of source is it connecting to? etc?
Or are you just trying to implement ping and see whether you can contact an IP?
For the first, splitting on the dots and then checking that the results are 4 integers >= 0 and <= 255.
For the later, it would really depend on what the rest of your code is doing. How is it initiating the connection? What type of source is it connecting to? etc?
Or are you just trying to implement ping and see whether you can contact an IP?
#3
Re: IP validation
Posted 15 October 2008 - 08:38 AM
If you're just wanting to make sure the user provided a valid IP address, in the proper format, check out this snippet that will validate the IP address using Regular Expressions.
If. however, you're wanting to make sure the IP address actually exists check out the Ping Class in the .Net Framework
Also,
Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.
Please post like this:
Thank you for helping us helping you.
If. however, you're wanting to make sure the IP address actually exists check out the Ping Class in the .Net Framework
Also,
Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.
Please post like this:
Thank you for helping us helping you.
Page 1 of 1

Start a new topic
Add Reply





MultiQuote
| 


