Tutorials
Resources
Forum
Communities
Interview
Jobs
Projects
Offshore Development
Silverlight Tutorials
|
Mentor
|
Code Converter
|
Articles
|
Code Factory
|
Computer Jokes
|
Members
|
Peer Appraisal
|
IT Companies
|
Bookmarks
|
Revenue Sharing
|
Prizes & Awards
My Profile
Sign In
Register
AdSense Revenue
Active Members
Today
Appukuttan
(94)
Abhi
(72)
Babu Akkandi
(63)
Last 7 Days
Appukuttan
(619)
Babu Akkandi
(470)
divya
(321)
more...
New Feature:
Community Sites
:
Create your own .NET community website and start earning from Google AdSense !
It's Free !
How to validate an IP address from 1.0.0.0 to 255.255.255.255
Posted Date: 03 May 2008
Resource Type:
Code Snippets
Category:
Validations
Author:
Rekha
Member Level:
Gold
Rating:
Points
: 0
The following code sample will help in validating an ip address
Public Function ValidIP(ByVal addr As String) As Boolean
'create our match pattern
Dim pat As String = "^([1-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\." & _
"([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3}$"
Dim check As New Text.RegularExpressions.Regex(pat)
'boolean variable to hold the status
Dim valid As Boolean = False
If addr = "" Then
valid = False
Else
valid = check.IsMatch(addr, 0)
End If
'return the results
Return valid
End Function
Responses
No responses found. Be the first to respond and make money from
revenue sharing program
.
Feedbacks
Popular Tags
What are tags ?
Search Tags
Sign In
(No tags found.)
Post Feedback
This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must
Sign In
to post a response.
Next Resource:
Validating a textbox to enter only numerics and no special characters or characters
Previous Resource:
How to validate an email address
Return to Discussion Resource Index
Post New Resource
Category:
Validations
Post resources and
earn money
!
Related Resources
Validate SSN
Javascript function for validating Date fields
How to check and see if a string is all uppercase in c#
Remove Trailing and Extra Spaces/Non-Printing Characters
How to validate an email address
dotNet Slackers
BizTalk Adaptors
Web Design
Contact Us
Privacy Policy
Terms Of Use