School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!
You're Browsing As A Guest! Register Now...
Become an Expert!

Join 358,485 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 2,188 people online right now.Registration is fast and FREE... Join Now!



IP validation

52 Weeks of Code Challenge: Android

Week #11 of the 52 Weeks of Code Challenge is Android, you should give it a shot. Click Here!

IP validation Rate Topic: -----

#1 Shankarsampath  Icon User is offline

  • New D.I.C Head
  • Pip

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 15-October 08


Dream Kudos: 0

Posted 15 October 2008 - 04:32 AM

How to code for the IP validation? means I want to check the connectivity for the given IP address
Was This Post Helpful? 0
  • +
  • -


#2 wingot  Icon User is offline

  • D.I.C Head
  • PipPip

Reputation: 0
  • View blog
  • Posts: 50
  • Joined: 13-October 08


Dream Kudos: 0

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?
Was This Post Helpful? 0
  • +
  • -

#3 PsychoCoder  Icon User is offline

  • apt-get install DIC.bin
  • Icon

Reputation: 731
  • View blog
  • Posts: 16,951
  • Joined: 26-July 07


Dream Kudos: 12450

Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net, jQuery

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.
Was This Post Helpful? 0
  • +
  • -



Fast Reply

  

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month