register.aspx页面<form id="form1" action="login.aspx" method="post"><input id="UserName" name="UserName" type="text" /><input id="Pwd" name="pwd" type="password" /><input id="Submit1" type="submit" value="注册" /></form> register.aspx.cs页面string str1 = Convert.ToString(!string.IsNullOrEmpty(Request.Form["UserName"]));string sre2 =Convert.ToString(!string.IsNullOrEmpty( Request.Form["pwd"]));string sqlstr = "Server=.; DataBase=MusicShop; User id=sa; password=123;";SqlConnection conn = new SqlConnection(sqlstr);conn.Open();string str = "insert into login values('" + str1.ToString() + "','" + sre2.ToString() + "')";SqlCommand con = new SqlCommand(str, conn);int a = con.ExecuteNonQuery();
- 1 回答
- 0 关注
- 765 浏览
添加回答
举报
0/150
提交
取消