最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
asp.net用户注册程序
时间:2022-06-25 05:35:49 编辑:袖梨 来源:一聚教程网
asp教程.net用户注册程序
asp教程x.cs" inherits="register" %>
var msg = eval(data);
if (msg == 1) {
$("#spanusercode").html('sorry该用户名已经存在!');
$("#btnregister").hide();
} else {
$("#spanusercode").html('恭喜您该用户名可以使用!');
$("#btnregister").show();
}
})
return result;
}
后台:
protected void btnregister_click(object sender, eventargs e)
{
string usercode = txtusercode.text.trim();
string userpwd = common.getmd5(txtpwd.text.trim());
string username = txttruename.text;
string sql = string.empty;stringbuilder sb = new stringbuilder();
sb.append("insert into nw_admin(nw_usercode,nw_pwd,nw_username,nw_class)");
sb.append("values('" + usercode + "','" + userpwd + "','" + username + "',0)");
int temp = sqlhelp.executesql(sb.tostring());
if (temp > 0)
common.jsredirect("注册成功!", "questionlist.aspx");
}
%>
//ashx文件:作为服务器与数据库教程交互,js传过来的用户名
using system;
using system.web;public class register : ihttphandler {
public void processrequest (httpcontext context) {
context.response.contenttype = "text/plain";
if (!string.isnullorempty(context.request["usercode"]))
{
string usercode = context.request["usercode"].tostring();
string sql = "select count(1) from nw_admin where nw_usercode='"+usercode.trim()+"'";
bool result = sqlhelp.exists(sql);
if (result)
context.response.write(1);
else
context.response.write(0);
}
}
public bool isreusable {
get {
return false;
}
}}
%》
相关文章
- 超级机器人大战Y特别生日怎么设置 4月20日B型效果说明 09-14
- 超级机器人大战Y前期机体怎么选 强力机体推荐攻略 09-14
- 原神爱诺瓦伊爱希队怎么玩 爱诺配队大全攻略 09-14
- 原神爱诺要抽几命 爱诺命座抽取攻略 09-14
- 三角洲行动qbz95怎么改 qbz95突击步枪满配改装方案 09-14
- 超级机器人大战Y难度怎么选 各难度区别及选择建议 09-14