Esempio n. 1
0
        void CheckEmail()
        {
            string email = We7Helper.FilterHtmlChars(HttpContext.Current.Request["email"]);

            HttpContext.Current.Response.Clear();
            if (email == "")
            {
                HttpContext.Current.Response.Write("false|Email不能为空");
            }
            else if (!Regex.IsMatch(email, @"\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"))
            {
                HttpContext.Current.Response.Write("false|Email格式不正确");
            }
            else if (AccountHelper.ExistEmail(email))
            {
                HttpContext.Current.Response.Write("false|该电子邮箱名已被使用");
            }
            else
            {
                HttpContext.Current.Response.Write("true|");
            }
            HttpContext.Current.Response.End();
        }