Email Validation inside webservice.

Discussion in 'ASP .Net Web Services' started by Mathias Wührmann, Apr 25, 2007.

  1. Hi Srini,

    Srini schrieb:
    > Im getting user information in webservice and storing in DB. In the
    > email address field, i do want to validate the email address.
    > like is give properly r not. (@ .) these things i wanna
    > check inside the webservice.


    check <http://www.regular-expressions.info/email.html> for general
    information how to correctly validate an email address regarding a
    correct format.

    Also, check this article about E-Mail address validation:
    http://www.codeproject.com/useritems/E-Mail_address_validation.asp

    Regards,

    Mathias Wuehrmann
    --
    http://www.flexact.de (Software, Consulting, Services)
    Mathias Wührmann, Apr 25, 2007
    #1
    1. Advertising

  2. Mathias Wührmann

    Srini Guest

    Hi all,
    Im getting user information in webservice and storing in DB. In the
    email address field, i do want to validate the email address.

    like is give properly r not. (@ .) these things i wanna
    check inside the webservice.

    Please help me.

    Any help vud be appreciatable.

    Thanks & Regards,
    Srinivasan.K
    Srini, Apr 26, 2007
    #2
    1. Advertising

  3. Mathias Wührmann

    Srini Guest

    Hi all,
    i found the solution for this.

    we can use like this:

    public bool IsValidEmail(string strIn)
    {
    // Return true if strIn is in valid e-mail format.
    return Regex.IsMatch(strIn,
    @"^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$");
    }

    and we need to add the name space : system.text.regularexpressions;

    this function will return wheather the given email address is valid or not.
    Thanks to all.


    Thanks & Regards,
    Srinivasan.K



    "Srini" <> wrote in message
    news:...
    > Hi all,
    > Im getting user information in webservice and storing in DB. In the
    > email address field, i do want to validate the email address.
    >
    > like is give properly r not. (@ .) these things i wanna
    > check inside the webservice.
    >
    > Please help me.
    >
    > Any help vud be appreciatable.
    >
    > Thanks & Regards,
    > Srinivasan.K
    >
    >
    >
    Srini, Apr 26, 2007
    #3
  4. Mathias Wührmann

    Srini Guest

    Thanks Mathias Wührmann.

    I got the solution.

    --


    Thanks & Regards,
    Srinivasan.K
    Mobile : +91-9840100320
    E-Mail :
    "Mathias Wührmann" <> wrote in message
    news:%23tqp%...
    > Hi Srini,
    >
    > Srini schrieb:
    >> Im getting user information in webservice and storing in DB. In the
    >> email address field, i do want to validate the email address.
    >> like is give properly r not. (@ .) these things i wanna
    >> check inside the webservice.

    >
    > check <http://www.regular-expressions.info/email.html> for general
    > information how to correctly validate an email address regarding a correct
    > format.
    >
    > Also, check this article about E-Mail address validation:
    > http://www.codeproject.com/useritems/E-Mail_address_validation.asp
    >
    > Regards,
    >
    > Mathias Wuehrmann
    > --
    > http://www.flexact.de (Software, Consulting, Services)
    Srini, Apr 26, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. batista
    Replies:
    1
    Views:
    887
    Laurent Bugnion
    Jan 26, 2006
  2. batista
    Replies:
    0
    Views:
    544
    batista
    Jan 26, 2006
  3. Mr. x
    Replies:
    2
    Views:
    694
    Andrew
    Oct 10, 2003
  4. Cyril
    Replies:
    2
    Views:
    4,479
    Cyril
    Jun 1, 2006
  5. Mr. x

    use another webservice in a webservice

    Mr. x, Sep 26, 2003, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    134
    Mr. x
    Sep 26, 2003
Loading...

Share This Page