最新下载
热门教程
- 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;
}
}}
%》
相关文章
- 如何关闭UC浏览器广告 04-10
- 如何修改7743游戏盒子里的游戏 04-10
- 笔袋下载的文件存哪里 04-10
- 羊驼日语app如何进行配音 04-10
- XMind如何导出Freemind格式 04-10
- 掌阅如何添加书签 04-10