Groups | Blog | Home
all groups > asp.net webservices > april 2007 >

asp.net webservices : Email Validation inside webservice.


Mathias_Wührmann
4/25/2007 3:20:22 PM
Hi Srini,

Srini schrieb:
[quoted text, click to view]

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
--
Srini
4/25/2007 5:39:49 PM
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 xyz@abc.com 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
4/25/2007 6:41:39 PM
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



[quoted text, click to view]

Srini
4/25/2007 8:20:37 PM
Thanks Mathias Wührmann.

I got the solution.

--


Thanks & Regards,
Srinivasan.K
Mobile : +91-9840100320
E-Mail : srinivasan.vk@sybrant.com
[quoted text, click to view]

AddThis Social Bookmark Button