Private Sub txt_mail_Validating(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles txt_mail.Validating
If txt_mail.Text <> String.Empty Then
reg = New Regex("^[_a-z0-9-]+(.[a-z0-9-]+)@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,4})$")
If Not reg.IsMatch(txt_mail.Text) Then
EP_Error.SetError(txt_mail, "not Mail!")
EP_Ok.SetError(txt_mail, "")
e.Cancel = True
Else
EP_Error.SetError(txt_mail, "")
EP_Ok.SetError(txt_mail, "OK")
End If
reg = Nothing
End If
End Sub
Home
mail validation
- Details
- Written by Super User
- Category: Visual Studio
- Hits: 2134