private void Merchant() { //注册信息 SHA1 sha1 = SHA1.Create(); byte[] passWord2 = sha1.ComputeHash(Encoding.Unicode.GetBytes(this.txtpassWords.Value.ToString().Trim())); LoginInfoModel model = new LoginInfoModel(); if (Request.Cookies["adv_cpa"] != null) { HttpCookie logCook = Request.Cookies["adv_cpa"]; model.adsiteID = logCook.Value.ToString(); model.autoReg = 2; } model.CompanyName = ""; model.LoginName = this.txtloginName.Value.ToString().Trim(); model.Password = passWord2; model.NickName = ""; model.PWDQuestion = ""; model.PWDAnswere = ""; model.RoleName = "0";//会员 model.ManageTypeID = "2001"; model.MemberGradeID = "1001"; model.IsCheckUp = false; model.Email = this.txtemail.Value.ToString().Trim(); string phone = txtCount.Value.ToString().Trim() + "-" + txtStatCount.Value.ToString().Trim() + "-" + txtTel.Value.ToString().Trim(); model.Tel = phone; model.RequirInfo = "0"; //----联系信息 OrgContactModel orgModel = new OrgContactModel(); orgModel.Email = this.txtemail.Value.ToString().Trim();; //邮箱 orgModel.IsDel = false; orgModel.LoginName = this.txtloginName.Value.ToString().Trim(); //登录名 orgModel.Mobile = txtMoblie.Value.ToString().Trim(); //手机 orgModel.Name = ""; //用户真实姓名 orgModel.OrganizationName = ""; //招商机构名称 orgModel.TelCountryCode = txtCount.Value.ToString().Trim(); orgModel.TelNum = txtTel.Value.ToString().Trim(); orgModel.TelStateCode = txtStatCount.Value.ToString().Trim(); orgModel.address = ""; //通讯地址 orgModel.PostCode = ""; //邮编 //--------会员信息 MemberInfoModel memberModel = new MemberInfoModel(); memberModel.LoginName = this.txtloginName.Value.ToString().Trim(); //登录名 memberModel.NickName = ""; //昵称 memberModel.Email = this.txtemail.Value.ToString().Trim(); //邮箱 memberModel.RequirInfo = ""; memberModel.Tel = phone.ToString().Trim(); //电话 memberModel.Mobile = txtMoblie.Value.ToString().Trim(); //手机 memberModel.Birthday = DateTime.Now; //生日 memberModel.ContactTitle = ""; //招商机构名称 memberModel.PostCode = ""; //邮编 memberModel.CountryCode = null; //国别 memberModel.ProvinceID = null; //省 memberModel.CountyID = null; //市 memberModel.CityID = null; //县 memberModel.Address = ""; //地址 memberModel.MemberName = ""; //用户真实姓名 LoginInfoBLL loginfo = new LoginInfoBLL(); common orgContect = new common(); MemberInfoBLL member = new MemberInfoBLL(); try { //向注册表写数据 try { loginfo.LogInfoAdd(model); } catch (System.Data.SqlClient.SqlException ex) { throw (new Exception(ex.Message)); } //政府注册 orgContect.AddOrgContect(orgModel); //会员信息 int i = member.MemberMessage_Insert(memberModel); //邀请注册 //if (invite.Trim().Length > 0) //{ // loginfo.InviterRegiste(Request.UserHostAddress, email, invite); //} string encryEmail = Server.UrlEncode(DEncrypt.Encrypt(this.txtemail.Value.ToString().Trim())); string encryLogname = Server.UrlEncode(DEncrypt.Encrypt(this.txtloginName.Value.ToString().Trim())); string act = Server.UrlEncode(DEncrypt.Encrypt("register")); string strPass = Server.UrlEncode(DEncrypt.Encrypt(this.txtpassWords.Value.ToString().Trim())); string ValidUrl = "ValidSuccessGov.aspx?email=" + encryEmail + "&logname=" + encryLogname + "&act=" + act + "&PassWord="******"数据提交时出错,注册失败。"); } finally { string encryEmail = Server.UrlEncode(DEncrypt.Encrypt(this.txtemail.Value.ToString().Trim())); string encryLogname = Server.UrlEncode(DEncrypt.Encrypt(this.txtloginName.Value.ToString().Trim())); string act = Server.UrlEncode(DEncrypt.Encrypt("register")); string strPass = Server.UrlEncode(DEncrypt.Encrypt(this.txtpassWords.Value.ToString().Trim())); string ValidUrl = "ValidSuccessGov.aspx?email=" + encryEmail + "&logname=" + encryLogname + "&act=" + act + "&PassWord=" + strPass; Response.Redirect(ValidUrl, true); } }
private void sdt() { string loginName; string passWord; string nikeName; string email; string phone; string zone; string mobile; string groupName; //单位名称 string requirInfo; //意向 string country; string invite; string tel; string answer; string question; loginName = this.usrname.Value; passWord = Request.Form["repwd"]; nikeName = Request.Form["nikemame"]; email = Request.Form["email"]; tel = Request.Form["phone"]; groupName = Request.Form["comname"]; country = Request.Form["country"]; zone = Request.Form["zone"]; mobile = Request.Form["mobile"]; requirInfo = Request.Form["coop"]; invite = Request.Form["invite"]; answer = Request.Form["answer"]; question = Request.Form["question"]; phone = country + "-" + zone + "-" + tel; #region 验证提交的验证码并清空验证码 ///-------------------------------------------------- ///--验证提交的验证码并清空验证码 ///-------------------------------------------------- string vercode; vercode = Request.Form["vercode"]; string strRndNum = ""; //SESSION丢失 if (Session["valationNo"] == null) { Response.Write("<script>alert('操作超时!请刷新页面!');</script>"); return; } else { if (vercode.Trim() == "") { Response.Write("<script>alert('验证码不能为空,请重新提交!');</script>"); return; } else { strRndNum = Session["valationNo"].ToString(); if (vercode.Trim() != "" && vercode.ToLower().Trim() == strRndNum.ToLower()) { Session["valationNo"] = ""; } else { Response.Write("<script>alert('验证码错误,请重新提交!');</script>"); return; } } } #endregion //注册信息 SHA1 sha1 = SHA1.Create(); byte[] passWord2 = sha1.ComputeHash(Encoding.Unicode.GetBytes(passWord.Trim())); LoginInfoModel model = new LoginInfoModel(); if (Request.Cookies["adv_cpa"] != null) { HttpCookie logCook = Request.Cookies["adv_cpa"]; model.adsiteID = logCook.Value.ToString(); model.autoReg = 2; } model.CompanyName = this.comname.Value; model.LoginName = loginName; model.Password = passWord2; model.NickName = nikeName; model.PWDQuestion = question; model.PWDAnswere = answer; model.RoleName = "0";//会员 model.ManageTypeID = "2001"; model.MemberGradeID = "1001"; model.IsCheckUp = false; model.Email = email; model.Tel = phone; model.RequirInfo = requirInfo; //----联系信息 OrgContactModel orgModel = new OrgContactModel(); orgModel.Email = email; //邮箱 orgModel.IsDel = false; orgModel.LoginName = loginName; //登录名 orgModel.Mobile = mobile; //电话 orgModel.Name = this.contactname.Value; //用户真实姓名 orgModel.OrganizationName = this.comname.Value; //招商机构名称 orgModel.TelCountryCode = country; orgModel.TelNum = tel; orgModel.TelStateCode = zone; orgModel.address = this.TAddres.Value; //通讯地址 orgModel.PostCode = this.PpstCode.Value.ToString().Trim(); //邮编 //--------会员信息 MemberInfoModel memberModel = new MemberInfoModel(); memberModel.LoginName = loginName; //登录名 memberModel.NickName = nikeName; //昵称 memberModel.Email = email; //邮箱 memberModel.RequirInfo = requirInfo; memberModel.Tel = phone; //电话 memberModel.Mobile = mobile; //手机 memberModel.Birthday = DateTime.Now; //生日 memberModel.ContactTitle = this.contacttitle.Value.ToString().Trim(); //职位名称 memberModel.PostCode = this.PpstCode.Value.ToString().Trim(); //邮编 memberModel.CountryCode = this.ZoneSelectControl1.CountryID; //国别 memberModel.ProvinceID = this.ZoneSelectControl1.ProvinceID; //省 memberModel.CountyID = this.ZoneSelectControl1.CountyID; //市 memberModel.CityID = this.ZoneSelectControl1.CityID; //县 memberModel.Address = this.TAddres.Value; //地址 memberModel.MemberName = this.contactname.Value.ToString().Trim(); //用户真实姓名 LoginInfoBLL loginfo = new LoginInfoBLL(); common orgContect = new common(); MemberInfoBLL member = new MemberInfoBLL(); try { //向注册表写数据 try { loginfo.LogInfoAdd(model); } catch (System.Data.SqlClient.SqlException ex) { throw (new Exception(ex.Message)); } //政府注册 orgContect.AddOrgContect(orgModel); //会员信息 int i = member.MemberMessage_Insert(memberModel); //论坛会员注册 if (i > 0) { //BBS_Reg.Reg(nikeName, passWord, email); } //邀请注册 if (invite.Trim().Length > 0) { loginfo.InviterRegiste(Request.UserHostAddress, email, invite); } //添加邀请人 //if (loginName.Trim() != "" && invite.Trim() != "") //{ // AdSystem.Introducer ad = new AdSystem.Introducer(); // ad.AddIntroducer(loginName, invite); //} string encryEmail = Server.UrlEncode(DEncrypt.Encrypt(email)); string encryLogname = Server.UrlEncode(DEncrypt.Encrypt(loginName)); string act = Server.UrlEncode(DEncrypt.Encrypt("register")); string strPass = Server.UrlEncode(DEncrypt.Encrypt(passWord)); string ValidUrl = "ValidSuccessGov.aspx?email=" + encryEmail + "&logname=" + encryLogname + "&act=" + act + "&PassWord="******"数据提交时出错,注册失败。"); } finally { string encryEmail = Server.UrlEncode(DEncrypt.Encrypt(email)); string encryLogname = Server.UrlEncode(DEncrypt.Encrypt(loginName)); string act = Server.UrlEncode(DEncrypt.Encrypt("register")); string strPass = Server.UrlEncode(DEncrypt.Encrypt(passWord)); string ValidUrl = "ValidSuccessGov.aspx?email=" + encryEmail + "&logname=" + encryLogname + "&act=" + act + "&PassWord=" + strPass; Response.Redirect(ValidUrl, true); } }
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { string loginName; string passWord; string nikeName; string email; string phone; string zone; string country; string mobile; string groupName;//单位名称 string invite; string countrycode; string province; string capital; string city; string address; string intent;//意向 decimal cap = 1111; string tel; string anwser; string question; loginName = this.usrname.Value; passWord = Request.Form["repwd"]; nikeName = Request.Form["nikename"]; email = Request.Form["email"]; tel = Request.Form["phone"]; groupName = Request.Form["comname"]; zone = Request.Form["zone"]; country = Request.Form["country"]; mobile = Request.Form["mobile"]; invite = Request.Form["invite"]; countrycode = Request.Form["CountryListCN"]; province = Request.Form["provinceCN"]; capital = Request.Form["capitalCN"]; city = Request.Form["cityCN"]; address = Request.Form["address"]; intent = Request.Form["intent"]; anwser = Request.Form["answer"]; question = Request.Form["question"]; phone = country + "-" + zone + "-" + tel; #region 验证提交的验证码并清空验证码 ///-------------------------------------------------- ///--验证提交的验证码并清空验证码 ///-------------------------------------------------- string vercode = Request.Form["vercode"]; string strRndNum = ""; //SESSION丢失 if (Session["valationNo"] == null) { Response.Write("<script>alert('操作超时!请刷新页面!');</script>"); return; } else { if (vercode.Trim() == "") { Response.Write("<script>alert('验证码不能为空,请重新提交!');</script>"); return; } else { strRndNum = Session["valationNo"].ToString(); if (vercode.Trim() != "" && vercode.ToLower().Trim() == strRndNum.ToLower()) { Session["valationNo"] = ""; } else { Response.Write("<script>alert('验证码错误,请重新提交!');</script>"); return; } } } #endregion if (capital != "") { cap = Convert.ToDecimal(capital); } //注册信息 SHA1 sha1 = SHA1.Create(); byte[] passWord2 = sha1.ComputeHash(Encoding.Unicode.GetBytes(passWord.Trim())); LoginInfoModel model = new LoginInfoModel(); model.LoginName = loginName; model.Password = passWord2; model.NickName = nikeName; model.PWDAnswere = anwser; model.PWDQuestion = question; model.RoleName = "0";//会员 model.ManageTypeID = "1003"; model.MemberGradeID = "1001"; model.IsCheckUp = false; model.Email = email; model.Tel = phone; model.RequirInfo = intent; //--------会员信息 MemberInfoModel memberModel = new MemberInfoModel(); memberModel.LoginName = loginName; memberModel.NickName = nikeName; memberModel.Email = email; memberModel.Tel = phone; memberModel.Mobile = mobile; memberModel.CountryCode = country; memberModel.CountyID = city; memberModel.ProvinceID = province; memberModel.RequirInfo = intent; memberModel.Address = address; memberModel.Birthday = DateTime.Now; OrgContactModel contactModel = new OrgContactModel(); contactModel.address = address; contactModel.IsDel = false; contactModel.Mobile = mobile; contactModel.OrganizationName = groupName; contactModel.Email = email; contactModel.LoginName = loginName; contactModel.Name = ""; contactModel.TelCountryCode = country; contactModel.TelNum = tel; contactModel.TelStateCode = zone; contactModel.FaxCountryCode = country; LoginInfoBLL loginfo = new LoginInfoBLL(); common orgContact = new common(); MemberInfoBLL member = new MemberInfoBLL(); //向注册表写数据 try { try { loginfo.LogInfoAdd(model); } catch (System.Data.SqlClient.SqlException exp) { throw (new Exception(exp.Message)); } //企业注册 orgContact.AddOrgContect(contactModel); //会员信息 int i = member.MemberMessage_Insert(memberModel); //论坛会员注册 if (i > 0) { BBS_Reg.Reg(nikeName, passWord, email); } //邀请注册处理 if (invite.Trim().Length > 0) { loginfo.InviterRegiste(Request.UserHostAddress, email, invite); } //添加邀请人 if (loginName.Trim() != "" && invite.Trim() != "") { AdSystem.Introducer ad = new AdSystem.Introducer(); ad.AddIntroducer(loginName, invite); } string encryEmail = Server.UrlEncode(DEncrypt.Encrypt(email)); string encryLogname = Server.UrlEncode(DEncrypt.Encrypt(loginName)); string act = Server.UrlEncode(DEncrypt.Encrypt("register")); string ValidUrl = "ValidSuccessEnter.aspx?email=" + encryEmail + "&logname=" + encryLogname + "&act=" + act; Response.Redirect(ValidUrl, true); } catch (Exception ex) { Response.Write(ex.Message); //Tz888.Common.MessageBox.ShowBack("数据提交时出错,注册失败。"); } }