c# 与数据库相连后 如何实现用户注册的功能 求详细代码

来源:百度知道 编辑:UC知道 时间:2024/05/09 15:46:07

using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using blog.util;

public partial class hy_login : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void button_jcyh(object sender, EventArgs e)
{
string str = hy_count.Text;
string sqlstr = "select count(*) from hy where hy_count="+str+"";
Response.Write(sqlstr);
int myread = Convert.ToInt32( DataPublic.ExecuteScalar(sqlstr));
if (myread==0)
{
//Response.Write("帐号已存在,请重写帐号名!");
Response.Write("<script>alert(&