导航:首页 > 万维百科 > asp网站设计实例源码

asp网站设计实例源码

发布时间:2020-12-08 17:34:42

1、商业网站asp源代码

源码之家

2、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="
'创建记录对象
set rs=server.createobject("adodb.recordset")
%>

7,(userinfo.mdb ACCESS 数据库)
在ACCESS中建一个表,然后在这个表中建立字段名称
表名:info

字段名称 数据类型
id 自动编号
username 文本
password 文本
sex 文本
quest 文本
qq 文本
mail 文本
personalinfo 文本
ntime 文本

3、求一个用ASP做出来的简单的网页源代码,急!!!!!!

如果user表存在并且设计好。
假设字段分别为id,name,classname
那么如下代码即可。

name=request("name")
classname=request("classname")

set rs=server.createobject("adodb.recordset")
rs.open "select * from user",conn,1,3
rs.addnew
rs("name")=name
rs("classname")=classname
rs.update
rs.close

html的表单部分内,用你的那2个文容本框来输入就可以了。name和classname可以根据你自己的需要来改名。

多动手,祝你成功。

4、需要一个ASP.NET教学网站的案例(有源码最好)?

学asp.net 一边学一边自己动手做提高最快,

5、高分跪求ASP+html制作一个网站的论坛页面(最好有完整的源码)拜托了各位 谢谢

不是很抄懂网页制作的话,我建议朋友直接使用现成的论坛程序,前台显示可以非常简单的修改,asp做的有动网论坛,php做的有discuz。phpwind asp.net做的有maxbbs。 还有就是与你现在用的网站程序进行会员整合的话,根据需要选择上面其中一个,一般他们都有与网站整合的接口,希望能给朋友一些帮助。祝你建站愉快。

求采纳

6、asp网页设计源代码?

?

7、用asp动态网页制作一个简单的网站,有源代码及网页,万分感谢!!!急急急!!!

买个域名、虚拟主机,然后上传安装网站代码
扣我买域名、虚拟主机,免费给上传安装网站代码

8、怎样查看一个网站的ASP网页源码

.......你说的那个是98年前的BUG了吧...都过了近10年了..................................

9、asp网站整站源码下载

找牛人入侵服务后台得到ftp用户密码下载。

10、求一个简洁漂亮的asp源码网站程序

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="admin.aspx.vb" Inherits="Mboard.admin"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>留言管理</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
<SCRIPT language="JavaScript">
//展开和关闭时候显示/隐藏子表信息
function showDiv(img,div)
{
var picName = img.src;
picName = picName.substring(picName.lastIndexOf("/")+1);
if (picName.toLowerCase() == "open.gif")
{
div.style.display ="block";
img.src = "image/close.gif";
}
else
{
div.style.display ="none";
img.src = "image/open.gif";
}
}

function AddRemoveValues(oChk)
{
//在处理这个地方需要注意的是:你保存的值应该具有唯一性,这样才能不会替换错误的项。
if(oChk.checked)
Form1.HdnSelectedValues.value += "," + oChk.value;
else
Form1.HdnSelectedValues.value = Form1.HdnSelectedValues.value.replace("," + oChk.value,"");
}
</SCRIPT>
</HEAD>
<body background="image/bookbg.gif" MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<FONT face="宋体">
<TABLE id="Table1" style="Z-INDEX: 101; LEFT: 80px; WIDTH: 797px; POSITION: absolute; TOP: 8px"
cellSpacing="0" cellPadding="0" width="797" align="center" border="0">
<TR>
<TD style="FONT-SIZE: 20px; COLOR: #505050; HEIGHT: 16px" align="center" vAlign="top"><b>后台管理</b><br>
<HR width="100%" color="#000066" SIZE="2">
<TABLE id="Table2" style="WIDTH: 600px; HEIGHT: 16px" cellSpacing="0" cellPadding="0" width="600"
border="0">
<TR>
<TD align="center"><A href="admin.aspx">留言管理</A>
</TD>
<TD align="center"> <A href="changepsw.aspx">修改密码</A></TD>
<TD align="center"> <A href="logout.aspx">退出登录</A></TD>
</TR>
</TABLE>
<br>
<TABLE id="Table2" cellSpacing="0" cellPadding="0" width="760" border="0">
<TR>
<TD vAlign="top" align="center"><asp:datagrid id="dgword" runat="server" Width="656px" AutoGenerateColumns="False" BackColor="#FFFFF6"
Height="96px" ShowHeader="False" Font-Size="9pt" AllowPaging="True" OnPageIndexChanged="dgword_SelectedIndexChanged" OnItemCommand="dgword_DeleteComand">
<FooterStyle ForeColor="#000066" BackColor="White"></FooterStyle>
<SelectedItemStyle Font-Bold="True" ForeColor="White" BackColor="#669999"></SelectedItemStyle>
<ItemStyle ForeColor="#000066"></ItemStyle>
<HeaderStyle Font-Bold="True" ForeColor="White" BackColor="#006699"></HeaderStyle>
<Columns>
<asp:TemplateColumn>
<ItemTemplate>
<TABLE height="1" width="767" border="0">
<TR>
<TD width="30">
<asp:Label id=LblId Font-Size="9pt" Visible="False" Height="4px" text='<%# DataBinder.Eval(Container.DataItem,"id")%>' Runat="server">
</asp:Label>
<asp:Image id="ImgOpen" style="CURSOR: hand" open="true" Runat="server" ImageUrl="image/open.gif"></asp:Image></TD>
<TD align="left" width="300">
<INPUT type="checkbox" onClick="AddRemoveValues(this)" value='<%#DataBinder.Eval(Container.DataItem,"id")%>' NAME="chkSelect">
<asp:Label id="Label1" runat="server" Font-Size="9pt">留言人:</asp:Label>
<asp:Label id=LblName Font-Size="9pt" Text='<%# DataBinder.Eval(Container.DataItem,"Name")%>' Runat="server">
</asp:Label></TD>
<TD align="left" width="317">         
<asp:Label id="Label3" runat="server" Font-Size="9pt">日期:</asp:Label>
<asp:Label id=Label4 runat="server" Font-Size="9pt" Text='<%# DataBinder.Eval(Container.DataItem,"date")%>'>lbltime</asp:Label></TD>
<TD align="right" width="120">
<asp:LinkButton id="LbtnDel" Font-Size="9pt" Text="删除" Runat="server" CommandName="Delete"></asp:LinkButton></TD>
</TR>
<TR>
<TD align="center" bgColor="#fefefe" colSpan="4">
<asp:Panel id="PnlContent" style="DISPLAY: none" BackColor="Silver" Border="0" Runat="server">
<table width="660" cellpadding="2" cellspacing="1" border="0" bgcolor="#3a97eb" style="FONT-SIZE: 9pt; WORD-BREAK: break-all">
<tr bgcolor="#ffffff">
<td height="120" width="120" rowspan="2" align="center" valign="top">
<%# DataBinder.Eval(Container.DataItem,"img")%>
<br>
<br>
<%# DataBinder.Eval(Container.DataItem,"name")%>
<br>
<br>
<%# DataBinder.Eval(Container.DataItem,"date")%>
</td>
<td height="25">
<%# DataBinder.Eval(Container.DataItem,"title")%>
</td>
</tr>
<tr bgcolor="#ffffff">
<td height="95" valign="top" rowspan="1" colspan="1">
<%# DataBinder.Eval(Container.DataItem,"message")%>
</td>
</tr>
</table>
</asp:Panel></TD>
</TR>
</TABLE>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
<PagerStyle HorizontalAlign="Right" ForeColor="#000066" Position="TopAndBottom" BackColor="White"
Mode="NumericPages"></PagerStyle>
</asp:datagrid>
<asp:Button id="btndel" runat="server" Text="删除所选项"></asp:Button></TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
<INPUT id="HdnSelectedValues" type="hidden" name="HdnSelectedValues" runat="server">
</FONT>
</form>
</body>
</HTML>

与asp网站设计实例源码相关的知识