最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
asp.net用户注册程序
时间:2022-06-25 05:35:49 编辑:袖梨 来源:一聚教程网
asp教程.net用户注册程序
<%@ page language="c#" autoeventwireup="true" codefile="register.asp教程x.cs" inherits="register" %>
后台:
<%
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传过来的用户名
<%@ webhandler language="c#" class="register" %>
<%
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;
}
}}
%》
相关文章
- 《下一站江湖2》力士身份介绍 04-18
- 《下一站江湖2》周目开启方法 04-18
- 《星球工匠》售价介绍 04-18
- 《下一站江湖2》焕然一新怎么做 04-18
- 《下一站江湖2》行走身份介绍 04-18
- 《下一站江湖2》雁九天介绍 04-18