.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old October 24th, 2003, 05:47 PM
blue blue is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Philippines
Posts: 4 blue User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Red face Pls help me to validate EMAIL ID..ASAP!!!

hi! everyone.... im doing my project and i need some help from u who knows VB.Net..

does anyone know how to valid8 err, validate an email ID...considering the @ and .

i hope anyone can help me... As Soon AS Possible....

thanks and God's Speed... does any1 knows how to validate an EMAIL ID... considering the @ and . signs.....

Reply With Quote
  #2  
Old October 24th, 2003, 10:03 PM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,886 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 19 m 35 sec
Reputation Power: 18
Try using regular expressions...

"Email validator that adheres directly to the specification for email address naming. It allows for everything from ipaddress and country-code domains, to very rare characters in the username."


^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$

Coutesy of Andy Smith at Regular Expression Library


If you need help validating with regular expressions, refer to the article "Validate With Regular Expressions" from Visual Studio Magazine.

Reply With Quote
  #3  
Old October 25th, 2003, 03:44 AM
blue blue is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Philippines
Posts: 4 blue User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
thanks a lot... i'll try it later...=p

Reply With Quote
  #4  
Old October 27th, 2003, 09:33 PM
numbernine numbernine is offline
Up To His Eyes In Ads
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Chicago
Posts: 160 numbernine User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m 25 sec
Reputation Power: 16
The drag and drop regular expression validator in VS.Net has an email validator built-in to it.

Reply With Quote
  #5  
Old October 28th, 2003, 12:18 PM
blue blue is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Philippines
Posts: 4 blue User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
uhmmm... my language that im using is .vb

err... im doing windows application and not a web application(.aspx).....

thnx anyway... i guess the one that was post up there used for aspx....?

Reply With Quote
  #6  
Old December 30th, 2003, 04:15 AM
jypgn jypgn is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: Banglore(India)
Posts: 2 jypgn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to jypgn
Validating e-mail ID

Private Sub MyValidatingCode()
' Confirm there is text in the control.
If TextBox1.Text.Length = 0 Then
Throw New Exception("Email address is a required field")
Else
If Not Regex.IsMatch(TextBox1.Text, "\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*") Then
Throw New Exception("E-mail address must be valid e-mail address format." + ControlChars.Cr + "For example 'someone@microsoft.com'")
End If
End If
End Sub

Private Sub textBox1_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles TextBox1.Validating
Try
MyValidatingCode()

Catch ex As Exception
' Cancel the event and select the text to be corrected by the user.
e.Cancel = True
TextBox1.Select(0, TextBox1.Text.Length)

' Set the ErrorProvider error with the text to display.
Me.ErrorProvider1.SetError(TextBox1, ex.Message)
End Try
End Sub

Private Sub textBox1_Validated(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles TextBox1.Validated
' If all conditions have been met, clear the error provider of errors.
ErrorProvider1.SetError(TextBox1, "")
End Sub

Reply With Quote
  #7  
Old March 1st, 2004, 04:54 AM
prasad prasad is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Posts: 1 prasad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 58 sec
Reputation Power: 0
Quote:
Originally Posted by numbernine
The drag and drop regular expression validator in VS.Net has an email validator built-in to it.


can somebody tell me how to use builtin email validator ???

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgramming.NET Development > Pls help me to validate EMAIL ID..ASAP!!!


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap