Welcome to Dream.In.Code
Getting C# Help is Easy!

Join 136,417 C# Programmers for FREE! Get instant access to thousands of C# experts, tutorials, code snippets, and more! There are 2,349 people online right now. Registration is fast and FREE... Join Now!




IP validation

 
Reply to this topicStart new topic

IP validation

Shankarsampath
15 Oct, 2008 - 04:32 AM
Post #1

New D.I.C Head
*

Joined: 15 Oct, 2008
Posts: 1

How to code for the IP validation? means I want to check the connectivity for the given IP address
User is offlineProfile CardPM
+Quote Post

wingot
RE: IP Validation
15 Oct, 2008 - 07:46 AM
Post #2

New D.I.C Head
*

Joined: 13 Oct, 2008
Posts: 38

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?
User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: IP Validation
15 Oct, 2008 - 08:38 AM
Post #3

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 8,993



Thanked: 125 times
Dream Kudos: 8625
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
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 smile.gif

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.
User is online!Profile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/2/08 01:01PM

Live C# Help!

C# Tutorials

Reference Sheets

C# Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month