Z zarina Member Joined Nov 30, 2005 Messages 8 Programming Experience Beginner Dec 14, 2005 #1 hi, i want to know how to validate emailid in a textbox in vb.net.I should get a popup for an invalid emailid that is it should contain "@". with regards, zarina
hi, i want to know how to validate emailid in a textbox in vb.net.I should get a popup for an invalid emailid that is it should contain "@". with regards, zarina
kulrom Well-known member Joined May 10, 2005 Messages 2,854 Location Republic of Macedonia Programming Experience 10+ Dec 14, 2005 #2 let's the VS.NET does it for you ... hmmm btw, is this web or win project? Upvote 0 Downvote
JuggaloBrotha VB.NET Forum Moderator Staff member Joined Jun 3, 2004 Messages 4,530 Location Lansing, MI; USA Programming Experience 10+ Dec 14, 2005 #3 for winforms here how i do it: Private myRegEx As New System.Text.RegularExpressions.Regex("^[\w-]+(?:\.[\w-]+)*@(?:[\w-]+\.)+[a-zA-Z]{2,7}$") then just use myRegEx.IsMatch(Textbox.Text) to determine if a valid email address has been typed in Upvote 0 Downvote
for winforms here how i do it: Private myRegEx As New System.Text.RegularExpressions.Regex("^[\w-]+(?:\.[\w-]+)*@(?:[\w-]+\.)+[a-zA-Z]{2,7}$") then just use myRegEx.IsMatch(Textbox.Text) to determine if a valid email address has been typed in