‘壹’ asp中的登录注册的源码怎么写
分类: 教育/科学 >> 学习帮助
问题描述:
希望大家多多帮忙!!!!!!
解析:
1,(index 用户登陆页面)
<!-- #include file="conn" -->
<!-- blog.soowooo 悠悠长假期 -->
<>
<head>
<meta -equiv="Content-Type" content="text/; charset=gb2312">
<title>会员</title>
<style type=text/css>
<!--
body,td,th {
font-family: 宋体;
font-size: 14px;
}
-->
</style>
</head>
<body>
<center>
<p>会员注册系统</p>
<form name=form1 method="post" action="login">
<table width=34% border=0>
<tr>
<td width=33% height=30>用户名:</td>
<td width=67% height=30><input name=username type=text id="username" size="15"></td>
</tr>
<tr>
<td height=30>密 码:</td>
<td height=30><input name=password type=password id="password" size="15"></td>
</tr>
<tr>
<td colspan="2" align=center><input type=submit name=Submit value="确定">
<input type=reset name=Submit value="重置"></td>
</tr>
<tr>
<td colspan="2"><a href="reg" target="_self">注册</a></td>
</tr>
</table>
</form>
</center>
</body>
</>
2,(login 用户数据处理文件)
<!-- #include file="conn" -->
<%
'打开数据库判断用户是否存在,info为表名,username为字段名
set rsc=server.createobject("adodb.recordset")
sqlc="select * from info where username='"&request.Form("username")&"' and password='"&request.Form("password")&"'"
rsc.open sqlc,conn,1,1
session("username")=rsc("username")
session("password")=rsc("password")
session.Timeout=30
set rsc=nothing
response.Redirect("change")
'如果用户不存在,session("username")为空
%>
3,(change 用户信息修改页面)
<!-- #include file="conn" -->
<>
<head>
<meta -equiv="Content-Type" content="text/; charset=gb2312">
<title>修改</title>
<style type=text/css>
<!--
body,td,th {
font-size: 14px;
}
-->
</style></head>
<center>
<body>
<br>
<%
set rsc=server.createobject("adodb.recordset")
sqlc="select * from info where username='"&session("username")&"' and password='"&session("password")&"'"
rsc.open sqlc,conn,1,1
nr=rsc("password")
username=rsc("username")
password=rsc("password")
sex=rsc("sex")
qq=rsc("qq")
mail=rsc("mail")
add=rsc("add")
personalinfo=rsc("personalinfo")
vv=rsc("ntime")
set rsc=nothing
if nr="" then
response.Redirect("index")
end if
if strp(nr,request.Form("password"))=0 then
response.Write("欢迎你!"&request.Form("username"))
response.Write("你是在"&vv&"注册的")
session("username")=request.Form("username")
end if
if session("username")="" then
response.Redirect("index")
end if
%>
<form name=form1 method="post" action="change?ac=ch">
<table width=39% height=105 border=0 >
<tr>
<td width=27% height=30>用户名:</td>
<td width=73% height=30><input name=username type=text id="username" value="<%=username%>">
*</td>
</tr>
<tr>
<td height=30>密 码:</td>
<td height=30><input name=password type=text id="password" value="<%=password%>">
*</td>
</tr>
<tr>
<td height=30>性 别:</td>
<td height=30><input name=sex type=text id="sex" value="<%=sex%>"></td>
</tr>
<tr>
<td height=30>QQ:</td>
<td height=30><input name=qq type=text id="qq" value="<%=qq%>"></td>
</tr>
<tr>
<td height=30>Mail:</td>
<td height=30><input name=mail type=text id="mail" value="<%=mail%>"></td>
</tr>
<tr>
<td height=30>地 址:</td>
<td height=30><input name=add type=text id="add" value="<%=add%>"></td>
</tr>
<tr>
<td>介绍</td>
<td><textarea name=personalinfo cols="30" rows="6" id="personalinfo"><%=personalinfo%></textarea></td>
</tr>
<tr>
<td> </td>
<td><input type=submit name=Submit value="修改">
<a href="change?se=y" target="_self">退出系统</a></td>
<% if strp(request.QueryString("se"),"y")=0 then
session("username")=""
response.Redirect("index")
end if
%>
</tr>
</table>
</form>
<%
if strp(request.QueryString("ac"),"ch")=0 then
set rs=server.createobject("adodb.recordset")
sql="select * from info where username='"&session("username")&"'"
rs.open sql,conn,1,3
rs("username")=request.Form("username")
rs("password")=request.Form("password")
rs("mail")=request.Form("mail")
rs("sex")=request.Form("sex")
rs("qq")=request.Form("qq")
rs("add")=request.Form("add")
rs("personalinfo")=request.Form("personalinfo")
rs.update
set rs=nothing
response.Write("修改完成!")
end if
%>
</body>
</center>
</>
4,(reg 新用户注册页面)
<>
<head>
<meta -equiv="Content-Type" content="text/; charset=gb2312">
<title>用户注册</title>
<style type=text/css>
<!--
body,td,th {
font-family: 宋体;
font-size: 14px;
}
-->
</style>
</head>
<body>
<center>
用户注册<br>
<%
=request.QueryString("msg")
%>
<form name=form1 method="post" action="addnewdata?ac=adser">
<table width=39% height=105 border=0 >
<tr>
<td width=27% height=30>用户名:</td>
<td width=73% height=30><input name=username type=text id="username">
*</td>
</tr>
<tr>
<td height=30>密码:</td>
<td height=30><input name=password type=password id="password">
*</td>
</tr>
<tr>
<td height=30>确定密码:</td>
<td height=30><input name=password2 type=password id="password2">
*</td>
</tr>
<tr>
<td height=30>性别:</td>
<td height=30><input name=sex type=text id="sex"></td>
</tr>
<tr>
<td height=30>QQ:</td>
<td height=30><input name=qq type=text id="qq"></td>
</tr>
<tr>
<td height=30>Mail:</td>
<td height=30><input name=mail type=text id="mail"></td>
</tr>
<tr>
<td height=30>地址:</td>
<td height=30><input name=add type=text id="add"></td>
</tr>
<tr>
<td>个人介绍</td>
<td><textarea name=personalinfo cols="30" rows="6" id="personalinfo"></textarea></td>
</tr>
<tr>
<td> </td>
<td><input type=submit name=Submit value="提交"></td>
</tr>
</table>
</form>
</center>
</body>
</>
5,(addnewdata 新用户注册数据处理文件)
<!-- #include file="conn" -->
<>
<head>
<meta -equiv="Content-Type" content="text/; charset=gb2312">
<title>成功</title>
</head>
<body>
<%
ac=request.QueryString("ac")
msg="注册错误信息"
if request.Form("username")="" then
msg=msg&"<br>"&"用户名不能为空"
end if
if strp(cstr(request.Form("password")),cstr(request.Form("password2")))<>0 then
msg=msg&"<br>"&"两次密码输入不同"
end if
if len(request.Form("password"))<6 then
msg=msg&"<br>"&"密码太简单"
end if
if strp(msg,"注册错误信息")>0 then
response.Redirect("reg?msg="&msg)
end if
if ac="adser" then
set rsc=server.createobject("adodb.recordset")
sql="select * from info where username='"&request.Form("username")&"'"
rsc.open sql,conn,1,1
ck=rsc("username")
set rsc=nothing
if ck<>"" then
msg=msg&"<br>"&"用户名被人注册"
response.Redirect("reg?msg="&msg)
end if
dsql="select * from info where id is null"
set rs=server.createobject("adodb.recordset")
rs.open dsql,conn,1,3
rs.addnew
rs("username")=request.Form("username")
rs("password")=request.Form("password")
rs("mail")=request.Form("mail")
rs("sex")=request.Form("sex")
rs("qq")=request.Form("qq")
rs("add")=request.Form("add")
rs("personalinfo")=request.Form("personalinfo")
rs("ntime")=now
rs.update
set rs=nothing
%>
<center>
<a href="index" target="_self">注册成功,点击登陆</a>
</center>
<%
end if
%>
</body>
</>
6,(conn 数据库连接文件)
<%
'连接数据库开始
dim conn,rs,sql
on error resume next
dbpath=server.mappath("userinfo.mdb")
set conn=server.createobject("adodb.connection")
conn.open "PROVIDER=Microsoft.jet.OLEDB.4.0;data source="&dbpath
'创建记录对象
set rs=server.createobject("adodb.recordset")
%>
7,(userinfo.mdb ACCESS 数据库)
在ACCESS中建一个表,然后在这个表中建立字段名称
表名:info
字段名称 数据类型
id 自动编号
username 文本
password 文本
sex 文本
quest 文本
qq 文本
mail 文本
personalinfo 文本
ntime 文本
‘贰’ 求网页登录注册源码
分5个文件:
1:登录页面 login.htm
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>登录</title>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="33%" height="64" id="table1">
<form name="form" action="go.asp" method="post"><tr>
<td>用户名:<input name="user"></td>
</tr>
<tr>
<td>密 码:<input type="password" name="pwd"></td>
</tr>
<tr>
<td><input name="sub" value="登录" type="submit"></td>
</tr></form>
</table>
</body>
</html>
------------------------
2.数据库连接文件 conn.asp
<%set rs=server.createobject("adodb.recordset")
conn = "driver={Microsoft Access Driver (*.mdb)};DBQ="&server.mappath("data.mdb")
%>
-------------------------
3:登录检测页面 go.asp
<!-- #include file="conn.asp" -->
<%
pwd=request.Form("pwd")
set rs=server.createobject("adodb.recordset")
sql="select * from user where name='"&request.Form("user")&"'"
rs.open sql,conn,1,1
if rs.eof or rs.bof then'如果用户名不存在
response.Write"<script language=javascript>alert('请输入正确的用户名!');history.go(-1);</script>"
Response.End()
else
if rs("pwd")<>pwd then'如果密码不对
response.write "<script language=JavaScript>alert('密码有误!');history.back();</script>"
else
response.write("登录成功")'
end if
end if%>
-------------------------------
4。注册文件 add.asp
<!-- #include file="conn.asp" -->
<%
sql="select * from user where u_user='"&request.Form("user")&"'"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
if rs.BOF or rs.EOF then
rs.addnew
rs("name")=request.Form("user")
rs("pwd")=request.Form("pwd")
rs.update
rs.close
set rs=nothing
response.Write ("注册成功!")
else
rs.close
set rs=nothing
response.write ("此用户已被注册")
end if
%>
4。注册页面 re.htm
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>注册</title>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="33%" height="64" id="table1">
<form name="form" action="add.asp" method="post"><tr>
<td>用户名:<input name="user" size="23"></td>
</tr>
<tr>
<td>密 码:<input name="pwd" size="23" id="pwd"></td>
</tr>
<tr>
<td><input name="sub" value="注册" type="submit"></td>
</tr></form>
</table>
</body>
</html>
将这几个文件和数据库“data.mdb”放在同一目录内
数据库建一个USER表
含name pwd 两个字段 文本类型
运行login.htm测试登录
运行re.htm测试注册
‘叁’ 易语言软件账号注册系统和账号后台管理系统源码(简单就行)
那就是数组里出问题了呗。比如只有5个人点名,你非要点第6个名当然没人回答了,也就出错了也就是超出范围了
‘肆’ 求ASP源码,功能:可注册用户,用户可登记、添加、修改某物品资料,管理员可管理、查询、统计用户添加的物
有很多,你说具体点什么类型的asp源码
‘伍’ 求软件注册源码和注册机源码 (易语言)
程序名 返回值类型 公开 备 注
__启动窗口_创建完毕 精易论坛
参数名 类 型 参考 可空 数组 备 注
变量名 类 型 静态 数组 备 注
注册码 文本型
注册表 文本型
XP风格 (1)
注册码 = 到文本 (取硬盘特征字 () + 2234240 × 0)
注册表 = 到文本 (取文本注册项 (4, “SOFTWARE\ceshi\zhucema”, ))
如果 (注册码 = 注册表)
载入 (窗口1, , 假)
销毁 ()
编辑框1.内容 = 到文本 (取硬盘特征字 ())
子程序名 返回值类型 公开 备 注
_按钮1_被单击 精易论坛
参数名 类 型 参考 可空 数组 备 注
如果 (编辑框2.内容 = 到文本 (取硬盘特征字 () + 2234240 × 0))
信息框 (“注册成功”, 0, )
写注册项 (4, “SOFTWARE\ceshi\zhucema”, 到文本 (取硬盘特征字 () + 2234240 × 0))
载入 (窗口1, , 假)
销毁 ()
信息框 (“注册失败”, 0, )
子程序名 返回值类型 公开 备 注
_按钮2_被单击 精易论坛
参数名 类 型 参考 可空 数组 备 注
结束 ()
-------------------------------------------------------------------------------
【注册机源码】
窗口程序集名 基 类 公 开 备 注
窗口程序集1 精易论坛
变量名 类 型 数组 备 注
子程序名 返回值类型 公开 备 注
__启动窗口_创建完毕 精易论坛
参数名 类 型 参考 可空 数组 备 注
XP风格 (1)
子程序名 返回值类型 公开 备 注
_按钮1_被单击 精易论坛
参数名 类 型 参考 可空 数组 备 注
变量名 类 型 静态 数组 备 注
注册码 文本型
机器码 整数型
机器码 = 到整数 (编辑框1.内容)
注册码 = 到文本 (机器码 + 2234240 × 0)
编辑框2.内容 = 注册码
子程序名 返回值类型 公开 备 注
_按钮2_被单击 精易论坛
参数名 类 型 参考 可空 数组 备 注
销毁 ()
‘陆’ JAVA用户注册 (我要源代码)
跑这儿作家庭作业了? 如果连用哪种页面技术都不知道提的话,恐怕别人给你源代码你也看不懂哦,想想别人给你个tapestry、Wicket之类的写的代码,拿给老师肯定挨批的哟(一看就露馅了)。
‘柒’ php 用户注册源码
<html>
<head>
<title>用户注册</title>
</head>
<body>
<strong>用户注册</strong>
<form action="reg.php" method="post">
用户名称:<input type="text" name="user"><br>
您的密码:<input type="password" name="pass"><br>
确定密码:<input type="password" name="pass2"><br>
<input type="submit" name="submit" value="注册">
</form>
</body>
</html>
<?php
include ('conn.php'); //这里是您配置的数据库
if($_POST[submit]){
//判断用户名不低于字数
$struser=strlen($_POST[user]);
if($struser <= 4){
echo "<script language=javascript>alert('注册请输入5位数以上');history.go(-1);</script>";
exit;
}
//判断用户是否存在
$users=$_POST[user];
$result=mysql_query("select * from manage where user='$users'");
$row=mysql_fetch_array($result);
if($_POST[user]==$row[user]){
echo "<script language=javascript>alert('啊!这个名字有人注册啦!');history.go(-1);</script>";
exit;
}
//判断用户密码两次输入正确
if($_POST[pass]!=$_POST[pass2]){
echo "<script language=javascript>alert('亲,别耍我啦,两次密码怎么能输入不一样呢?');history.go(-1);</script>";
exit;
}
$_POST[pass]=md5($_POST[pass]);
$sql=mysql_query("insert into manage(id,user,pass)
VALUES('','$_POST[user]','$_POST[pass]')
");
if($sql){
echo "<script language=javascript>alert('亲,注册成功!');history.go(-1);</script>";
}
else {
echo "<script language=javascript>alert('对不起,亲!注册失败咯!');history.go(-1);</script>";
}
exit;
}
mysql_close($con)
?>
我自己写的 很简单,100%适合新人。加密了密码,利用的是MD5
‘捌’ 跪求简单的php用户注册源码
<?php
include 'conn.php';
if($_POST['submit']){
$sql = "INSERT INTO admin (Aid,Aname,Apass) values ('','$_POST[Aname]','$_POST[Apass]')";
mysql_query($sql);
echo $sql;
}
?>
<script type="text/javascript">
function regcheck(){
if(regform.Aname.value==""){
alert("用户名不得为空");
regform.Aname.focus();
return false;
}
if(regform.Apass.value==""){
alert("密码不得为空");
regform.Apass.focus();
return false;
}
}
</script>
<form action="zhuceyeA.php" name="regform" method="post" onsubmit="return regcheck()">
注册管理员<br>
用户名:<input type="text" name="Aname">
密码:<input type="password" name="Apass">
<input type="submit" name="submit" value="注册">
</form>
//我也是初学者 大四 这个代码是我自己练手做的 数据库很简单 ID 用户名 密码(明文显示,为了简便起见) 高手不要笑话我。。。。
‘玖’ asp中的登录注册的源码怎么写
1,(index.asp 用户登陆页面)
<!-- #include file="conn.asp" -->
<!-- blog.soowooo.cn 悠悠长假期 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>会员</title>
<style type="text/css">
<!--
body,td,th {
font-family: 宋体;
font-size: 14px;
}
-->
</style>
</head>
<body>
<center>
<p>会员注册系统</p>
<form name="form1" method="post" action="login.asp">
<table width="34%" border="0">
<tr>
<td width="33%" height="30">用户名:</td>
<td width="67%" height="30"><input name="username" type="text" id="username" size="15"></td>
</tr>
<tr>
<td height="30">密 码:</td>
<td height="30"><input name="password" type="password" id="password" size="15"></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" name="Submit" value="确定">
<input type="reset" name="Submit" value="重置"></td>
</tr>
<tr>
<td colspan="2"><a href="reg.asp" target="_self">注册</a></td>
</tr>
</table>
</form>
</center>
</body>
</html>
2,(login.asp 用户数据处理文件)
<!-- #include file="conn.asp" -->
<%
'打开数据库判断用户是否存在,info为表名,username为字段名
set rsc=server.createobject("adodb.recordset")
sqlc="select * from info where username='"&request.Form("username")&"' and password='"&request.Form("password")&"'"
rsc.open sqlc,conn,1,1
session("username")=rsc("username")
session("password")=rsc("password")
session.Timeout=30
set rsc=nothing
response.Redirect("change.asp")
'如果用户不存在,session("username")为空
%>
3,(change.asp 用户信息修改页面)
<!-- #include file="conn.asp" -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>修改</title>
<style type="text/css">
<!--
body,td,th {
font-size: 14px;
}
-->
</style></head>
<center>
<body>
<br>
<%
set rsc=server.createobject("adodb.recordset")
sqlc="select * from info where username='"&session("username")&"' and password='"&session("password")&"'"
rsc.open sqlc,conn,1,1
nr=rsc("password")
username=rsc("username")
password=rsc("password")
sex=rsc("sex")
qq=rsc("qq")
mail=rsc("mail")
add=rsc("add")
personalinfo=rsc("personalinfo")
vv=rsc("ntime")
set rsc=nothing
if nr="" then
response.Redirect("index.asp")
end if
if strcomp(nr,request.Form("password"))=0 then
response.Write("欢迎你!"&request.Form("username"))
response.Write("你是在"&vv&"注册的")
session("username")=request.Form("username")
end if
if session("username")="" then
response.Redirect("index.asp")
end if
%>
<form name="form1" method="post" action="change.asp?ac=ch">
<table width="39%" height="105" border="0" >
<tr>
<td width="27%" height="30">用户名:</td>
<td width="73%" height="30"><input name="username" type="text" id="username" value="<%=username%>">
*</td>
</tr>
<tr>
<td height="30">密 码:</td>
<td height="30"><input name="password" type="text" id="password" value="<%=password%>">
*</td>
</tr>
<tr>
<td height="30">性 别:</td>
<td height="30"><input name="sex" type="text" id="sex" value="<%=sex%>"></td>
</tr>
<tr>
<td height="30">QQ:</td>
<td height="30"><input name="qq" type="text" id="qq" value="<%=qq%>"></td>
</tr>
<tr>
<td height="30">Mail:</td>
<td height="30"><input name="mail" type="text" id="mail" value="<%=mail%>"></td>
</tr>
<tr>
<td height="30">地 址:</td>
<td height="30"><input name="add" type="text" id="add" value="<%=add%>"></td>
</tr>
<tr>
<td>介绍</td>
<td><textarea name="personalinfo" cols="30" rows="6" id="personalinfo"><%=personalinfo%></textarea></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="Submit" value="修改">
<a href="change.asp?se=y" target="_self">退出系统</a></td>
<% if strcomp(request.QueryString("se"),"y")=0 then
session("username")=""
response.Redirect("index.asp")
end if
%>
</tr>
</table>
</form>
<%
if strcomp(request.QueryString("ac"),"ch")=0 then
set rs=server.createobject("adodb.recordset")
sql="select * from info where username='"&session("username")&"'"
rs.open sql,conn,1,3
rs("username")=request.Form("username")
rs("password")=request.Form("password")
rs("mail")=request.Form("mail")
rs("sex")=request.Form("sex")
rs("qq")=request.Form("qq")
rs("add")=request.Form("add")
rs("personalinfo")=request.Form("personalinfo")
rs.update
set rs=nothing
response.Write("修改完成!")
end if
%>
</body>
</center>
</html>
4,(reg.asp 新用户注册页面)
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>用户注册</title>
<style type="text/css">
<!--
body,td,th {
font-family: 宋体;
font-size: 14px;
}
-->
</style>
</head>
<body>
<center>
用户注册<br>
<%
=request.QueryString("msg")
%>
<form name="form1" method="post" action="addnewdata.asp?ac=adser">
<table width="39%" height="105" border="0" >
<tr>
<td width="27%" height="30">用户名:</td>
<td width="73%" height="30"><input name="username" type="text" id="username">
*</td>
</tr>
<tr>
<td height="30">密码:</td>
<td height="30"><input name="password" type="password" id="password">
*</td>
</tr>
<tr>
<td height="30">确定密码:</td>
<td height="30"><input name="password2" type="password" id="password2">
*</td>
</tr>
<tr>
<td height="30">性别:</td>
<td height="30"><input name="sex" type="text" id="sex"></td>
</tr>
<tr>
<td height="30">QQ:</td>
<td height="30"><input name="qq" type="text" id="qq"></td>
</tr>
<tr>
<td height="30">Mail:</td>
<td height="30"><input name="mail" type="text" id="mail"></td>
</tr>
<tr>
<td height="30">地址:</td>
<td height="30"><input name="add" type="text" id="add"></td>
</tr>
<tr>
<td>个人介绍</td>
<td><textarea name="personalinfo" cols="30" rows="6" id="personalinfo"></textarea></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="Submit" value="提交"></td>
</tr>
</table>
</form>
</center>
</body>
</html>
5,(addnewdata.asp 新用户注册数据处理文件)
<!-- #include file="conn.asp" -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>成功</title>
</head>
<body>
<%
ac=request.QueryString("ac")
msg="注册错误信息"
if request.Form("username")="" then
msg=msg&"<br>"&"用户名不能为空"
end if
if strcomp(cstr(request.Form("password")),cstr(request.Form("password2")))<>0 then
msg=msg&"<br>"&"两次密码输入不同"
end if
if len(request.Form("password"))<6 then
msg=msg&"<br>"&"密码太简单"
end if
if strcomp(msg,"注册错误信息")>0 then
response.Redirect("reg.asp?msg="&msg)
end if
if ac="adser" then
set rsc=server.createobject("adodb.recordset")
sql="select * from info where username='"&request.Form("username")&"'"
rsc.open sql,conn,1,1
ck=rsc("username")
set rsc=nothing
if ck<>"" then
msg=msg&"<br>"&"用户名被人注册"
response.Redirect("reg.asp?msg="&msg)
end if
dsql="select * from info where id is null"
set rs=server.createobject("adodb.recordset")
rs.open dsql,conn,1,3
rs.addnew
rs("username")=request.Form("username")
rs("password")=request.Form("password")
rs("mail")=request.Form("mail")
rs("sex")=request.Form("sex")
rs("qq")=request.Form("qq")
rs("add")=request.Form("add")
rs("personalinfo")=request.Form("personalinfo")
rs("ntime")=now
rs.update
set rs=nothing
%>
<center>
<a href="index.asp" target="_self">注册成功,点击登陆</a>
</center>
<%
end if
%>
</body>
</html>
6,(conn.asp 数据库连接文件)
<%
'连接数据库开始
dim conn,rs,sql
on error resume next
dbpath=server.mappath("userinfo.mdb")
set conn=server.createobject("adodb.connection")
conn.open "PROVIDER=Microsoft.jet.OLEDB.4.0;data source="&dbpath
'创建记录对象
set rs=server.createobject("adodb.recordset")
%>
7,(userinfo.mdb ACCESS 数据库)
在ACCESS中建一个表,然后在这个表中建立字段名称
表名:info
字段名称 数据类型
id 自动编号
username 文本
password 文本
sex 文本
quest 文本
qq 文本
mail 文本
personalinfo 文本
ntime 文本
‘拾’ 用户注册及登录管理 编写c语言程序,实现软件用户登录、注册功能。
/ /你看到自己专门为你烫一下注册和登录系统
1新用户注册
2登录
3退出
1
注册帐号:
请输入您的姓名:
KA西瓜
请输入您的密码:!
注册成功
注册和登录系统
1新用户注册
2登录
3退出
2
登录帐号:
请输入用户名:
KA西瓜
请输入密码:
确定登录成功
欢迎回来,KA西瓜
按任意键继续
! >#包括中
#包括的
无效新用户注册(); / /用户注册功能
无效登录(); / /用户登录功能
的main()
{
整数selectNum;
的printf(“\ nRegistered和登录系统\ n \ n已”);
printf(“请1新用户注册\ N”);
printf(“请2登录\ N”);
printf(“请3退出\ n”);
的scanf(“%d个”,&selectNum);
开关(selectNum)
{
案例1:新用户注册();
突破;
案例2:登录();
突破; 案例3:printf(“请!退出程序\ n”);
出口(1);
突破;
无效新用户注册()
{
文件*计划生育;
字符Linedata [50] = {0},用户[20],通[20];
计划生育=打开(“data.dat文件”,“在”);
printf(“请注册帐号:\ n”);
printf(“请输入你的姓名:\ n”);
FFLUSH(标准输入);
得到(用户);
printf(“请输入您的密码:\ n”);
FFLUSH(标准输入);
得到(通行证);
的strcpy(Linedata,用户);
的strcat(Linedata,“,”);
strcat的(Linedata,通行证);
strcat的(Linedata,“\ N”;);
FPUTS(Linedata,FP);
FCLOSE(FP);
printf(“请!注册成功\ n”);
的main();
}
无效登录()
{
文件*计划生育;
整型发现= 0;
用户的char [20],通[20],Userstrcat [50] = {0};
字符使用用户数据[50] = {0};
计划生育=打开(“data.dat文件”,“R”);
printf(“请登录帐号:\ n”);
printf(“请输入用户名:\ n”);
FFLUSH(标准输入);
得到(用户);
printf(“请输入密码:\ n”);
FFLUSH(标准输入);
得到(通行证);
的strcpy(Userstrcat,用户);
的strcat(Userstrcat,“,”);
strcat的(Userstrcat,通行证);
strcat的(Userstrcat,“\ N”);!
而(的feof(计划生育))
{
与fgets(使用用户数据,19,FP);
如果(STRCMP(保留使用者,Userstrcat)== 0)
{
printf(“请确定登录成功\ n!”);
printf(“请欢迎回来,%s的\ n!”,用户);
发现= 1;
突破;
如果
(find!){
的printf(“用户名或密码不正确\ n”);
FCLOSE(FP);
}