Hi Peep,s
I working on this project and having trouble finishing it.
I have go some stuff done but need the help
it is number 3 on assissgnment 5
CODE
Public Class fmTitle
Private Sub btnValidate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnValidate.Click
'Declaring the Variables'
Dim Email As String
Dim AtSymbol As Integer
Dim User As String
Dim Domain As String
Email = txtEnterEmail.Text.Trim
If Email.Contains(" ") Then
MessageBox.Show("Email address can't have spaces", "Validation Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
txtEnterEmail.Focus()
Return
ElseIf Email.Contains("..") Then
MessageBox.Show("Email address can't have consecutive periods", "Validation Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
txtEnterEmail.Focus()
Return
ElseIf Not Email.Contains("@") Then
MessageBox.Show("Email address must have one '@' symbol", "Validation Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
txtEnterEmail.Focus()
Return
End If
AtSymbol = Email.IndexOf("@")
If Email.Contains("@") Then
User = Email.Substring(0, AtSymbol)
Domain = Email.Substring(AtSymbol + 1)
Elseif
User = ""
Domain = ""
ElseIf Domain.Contains("@") Then
MessageBox.Show("Email address can't have more than one '@' symbol", "Validation Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
txtEnterEmail.Focus()
Return
End If
End Sub
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
'Closing the program
Me.Close()
End Sub
End Class
Mod Edit:Fixed broken code tags. Be sure to include both tags like below.