public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; var IDCardNo = context.Request["IDCardNo"]; int result; if (!IDCardVerifyTools.VerifyIDCard(IDCardNo)) { context.Response.Write("请输入正确的身份证号"); return; } result = WcfClient.Instance.CheckUserIDCardNoExist(IDCardNo); if (result == OperResult.RESULTCODE_FALSE) { context.Response.Write("OK"); } else if (result == OperResult.RESULTCODE_TRUE) { context.Response.Write("身份证号已经被其它人使用,无法注册"); } }
private bool CheckIDCardNo(string IDCardNo) { if (IDCardNo == "") { Response.Write("<script>alert('请输入身份证号!')</script>"); return(false); } if (!IDCardVerifyTools.VerifyIDCard(IDCardNo)) { Response.Write("<script>alert('请输入正确的身份证号')</script>"); return(false); } int result = WcfClient.Instance.CheckUserIDCardNoExist(IDCardNo); if (result == OperResult.RESULTCODE_TRUE) { Response.Write("<script>alert('身份证号已经被使用,无法再注册')</script>"); return(false); } return(true); }
private void btnOK_Click(object sender, RoutedEventArgs e) { //nickName = this.txtNickName.Text.Trim(); //if (string.IsNullOrEmpty(nickName)) //{ // MyMessageBox.ShowInfo("请填写昵称。"); // return; //} email = this.txtEmail.Text.Trim(); if (string.IsNullOrEmpty(email)) { MyMessageBox.ShowInfo("请填写邮箱。"); return; } bool matchValue = Regex.IsMatch(email, @"^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+"); if (!matchValue) { MyMessageBox.ShowInfo("请输入正确的邮箱"); return; } qq = this.txtQQ.Text.Trim(); if (string.IsNullOrEmpty(qq)) { MyMessageBox.ShowInfo("请填写QQ。"); return; } matchValue = Regex.IsMatch(qq, @"^([1-9][0-9]*)$"); if (!matchValue) { MyMessageBox.ShowInfo("请输入正确的QQ号"); return; } alipay = this.txtAlipayAccount.Text.Trim(); if (string.IsNullOrEmpty(alipay)) { MyMessageBox.ShowInfo("请填写支付宝账户。"); return; } matchValue = Regex.IsMatch(alipay, @"^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+"); if (!matchValue) { matchValue = Regex.IsMatch(alipay, @"^([1-9][0-9]*)$"); if (!matchValue) { MyMessageBox.ShowInfo("支付宝账户只能为电子邮箱或者手机号"); return; } else { if (alipay.Length != 11) { MyMessageBox.ShowInfo("支付宝账户只能为电子邮箱或者手机号"); return; } } } alipayRealName = this.txtAlipayRealName.Text.Trim(); if (string.IsNullOrEmpty(alipayRealName)) { MyMessageBox.ShowInfo("请填写支付宝实名认证的真实姓名。"); return; } matchValue = Regex.IsMatch(alipayRealName, @"^[\u4E00-\u9FA5\uF900-\uFA2D]"); if (!matchValue) { MyMessageBox.ShowInfo("支付宝实名只能为汉字"); return; } IDCardNoText = this.txtIDCardNo.Text.Trim(); if (!IDCardVerifyTools.VerifyIDCard(IDCardNoText)) { MyMessageBox.ShowInfo("请输入正确的身份证号。"); return; } AsyncChangePlayerSimpleInfo(alipay, alipayRealName, IDCardNoText, email, qq); }