Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Snippet] Check Email if gmail and valid password length
#4
Functions merge into one.

Code:
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        If checkemail(TextBox1.Text, TextBox2.Text) = True Then
            MsgBox("Email is valid")
        Else
            MsgBox("Email is invalid")
        End If
    End Sub

    Private Shared Function checkemail(ByVal email As String, pass As String) As Boolean
        ' If the email matches the regular expression
        Dim Expression As New System.Text.RegularExpressions.Regex("\S+@\S+\.\S+")
        If Expression.IsMatch(email) Then
            If email.Contains("@gmail.com") = True Then
                If pass.Length >= 8 Then
                    Return True
                Else
                    Return False 'Invalid password
                End If
            Else
                Return False 'Not a Gmail
            End If
        Else
            Return False 'Invalid email
        End If
    End Function
USB Anti-virus? Try USB Drive Defender
[Image: 8bQCusS.jpg]
Reply


Messages In This Thread
RE: [Snippet] Check Email if gmail and valid password length - by euverve - 05-17-2011, 09:16 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [SF Coders] Password Generator ★Cooldude★ 23 11,844 03-19-2012, 06:40 PM
Last Post: AceInfinity
  [Snippet] Autoclose Msgbox euverve 7 3,281 05-25-2011, 06:41 PM
Last Post: Pyratepig
  [Snippet] Get Local Getway euverve 1 1,024 05-16-2011, 07:56 PM
Last Post: KoBE
  [Snippet] Get OS Uptime euverve 0 875 05-12-2011, 07:08 PM
Last Post: euverve
  [Source] My Gmail Email Sender euverve 1 848 05-12-2011, 08:30 AM
Last Post: begginer

Forum Jump:


Users browsing this thread: 1 Guest(s)