Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. email validation in windows application [modified]

email validation in windows application [modified]

Scheduled Pinned Locked Moved Visual Basic
tutorial
6 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    praveenkumar palla
    wrote on last edited by
    #1

    Hi all how to accomplish email validation in windows application Thanks in advance PraveenKumar Palla -- modified at 9:39 Friday 22nd June, 2007

    S V C 3 Replies Last reply
    0
    • P praveenkumar palla

      Hi all how to accomplish email validation in windows application Thanks in advance PraveenKumar Palla -- modified at 9:39 Friday 22nd June, 2007

      S Offline
      S Offline
      Sathesh Sakthivel
      wrote on last edited by
      #2

      Email Validation[^]

      Regards, Satips.:rose:

      P 1 Reply Last reply
      0
      • S Sathesh Sakthivel

        Email Validation[^]

        Regards, Satips.:rose:

        P Offline
        P Offline
        praveenkumar palla
        wrote on last edited by
        #3

        Really i am verry sorry i need email validation in windows application

        D 1 Reply Last reply
        0
        • P praveenkumar palla

          Hi all how to accomplish email validation in windows application Thanks in advance PraveenKumar Palla -- modified at 9:39 Friday 22nd June, 2007

          V Offline
          V Offline
          Vasudevan Deepak Kumar
          wrote on last edited by
          #4

          You can have a syntax level regex validation. I have reviewed about fValidate here: http://lavanyadeepak.blogspot.com/2006/06/fvalidate-full-fledged-form-validation.html[^] Also, you can check out http://www.hexillion.com/[^] I also have a brief article on using regular expressions here: http://www.dotnetspider.com/kb/Article3033.aspx[^]

          Vasudevan Deepak Kumar Personal Homepage Tech Gossips

          1 Reply Last reply
          0
          • P praveenkumar palla

            Really i am verry sorry i need email validation in windows application

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #5

            The email address format validation is normally done by a regular expression. The link he posted was kind of accurate, but since it's a C++ article, it may be difficult to understand. This code was taken from this article[^] and converted to VB.NET.

            Imports System.Text.RegularExpressions
            .
            .
            .
            Public Shared Function EmailAddressIsValid(ByVal address As String) As Boolean
            Dim strRegex As String = "^([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})(\]?)$"
            Dim re As New Regex(strRegex)
            If re.IsMatch(address)
            Return True
            Else
            Return False
            End Function

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007

            1 Reply Last reply
            0
            • P praveenkumar palla

              Hi all how to accomplish email validation in windows application Thanks in advance PraveenKumar Palla -- modified at 9:39 Friday 22nd June, 2007

              C Offline
              C Offline
              ctwalker
              wrote on last edited by
              #6

              Try something like the following: Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim objRegEx As New System.Text.RegularExpressions.Regex("^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$") If objRegEx.IsMatch(TextBox1.Text) Then ErrorProvider1.SetError(sender, "") Else ErrorProvider1.SetError(sender, "Email address is not valid") End If End Sub You may have to adjust the regex depending on what you consider a valid email address.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups