Reg.cs
资源名称:yjal.rar [点击查看]
上传用户:shjujing
上传日期:2022-07-28
资源大小:11244k
文件大小:2k
源码类别:
Email客户端
开发平台:
Visual C++
- /********************************************************************************
- ** 作者:ebDoing
- ** 创始时间: 2008-10-22
- ** 描述:
- ** 主要用于后台管理员修改商品信息,…
- ** 表:
- *********************************************************************************/
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Data.SqlClient;
- using System.Configuration;
- namespace User
- {
- public class Reg
- {
- SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["CartConnectionString"].ConnectionString);
- /// <summary>
- ///
- /// </summary>
- /// <param name="name"></param>
- /// <param name="pass"></param>
- /// <param name="passtwo"></param>
- /// <param name="email"></param>
- /// <returns></returns>
- public int RegUser(String name, String pass, String passtwo, String email) {
- String T_name = name;
- String T_pass = pass;
- String T_passtwo = passtwo;
- String T_email = email;
- String sql="insert into U_Info(UserName,Password,ValidatePass,Email) values('"+T_name+"','"+T_pass+"','"+T_passtwo+"','"+T_email+"')";
- SqlCommand cmd = new SqlCommand(sql,conn);
- int Result = -1;
- try
- {
- conn.Open();
- Result = cmd.ExecuteNonQuery();
- }
- catch (Exception ex)
- {
- throw (ex);
- }
- finally
- {
- conn.Close();
- }
- return Result;
- }
- }
- }