仓酷云

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 452|回复: 9
打印 上一主题 下一主题

[学习教程] ASP网站制作之复杂的浮点论坛

[复制链接]
愤怒的大鸟 该用户已被删除
跳转到指定楼层
楼主
发表于 2015-1-16 23:16:11 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
只要你想学,就没什么优缺点,上面那位大哥已经把网上的评论说了,但我认为想学哪个都一样,不然它就不可能在当今时代数字艺术方面存活到今天
复杂的做了一个,扫描一次数据库可得一棵树
-----index.asp------

<html>
<head>
<title>浮点论坛</title></head>
<bodymarginwidth="0"marginheight="0">
<divalign="center">
<tablewidth="100%"border="0"cellspacing="0"cellpadding="0"height="24">
<tr>
<tdwidth="80"></td>
<td><ahref="#form">发新贴</A></td>
</tr>
</table>
<br>
<tableborder="0"width="90%"cellspacing="0"cellpadding="0">
<%setdbr=server.createobject("adodb.recordset")%>
<%dbr.pagesize=50%>
<%dbr.CacheSize=dbr.pagesize%>
<%dbr.open"select*fromforumwhere(isdel=n)orderbyiddesc",application("oledb"),1,1%>
<%msgcount=dbr.recordcount%>
<%msgpcount=dbr.pagecount%>
<%pagelist=request("pagelist")%>
<%ifCINT(pagelist)>dbr.pagecountthenpagelist=dbr.pagecount%>
<%ifCINT(pagelist)<1thenpagelist=1%>
<%dbr.AbsolutePage=pagelist%>
<%fori=1todbr.pagesize%>
<tr>
<tdwidth="100%"valign="top"align="left"colspan="2">
<tableborder="0"width="100%"cellspacing="0"cellpadding="0">
<tr>
<tdwidth="25%">姓名:<%=rtrim(dbr("name"))%></td>
<tdwidth="25%"><%ifrtrim(dbr("email"))""then%><%rtrim(dbr("email"))%><%endif%></td>
<tdwidth="25%">工夫:<%=datevalue(dbr("thedate"))%></td>
<%a=cdbl(dbr("id"))%>
<%next%>
<tdwidth="25%"><ahref="reply.asp?id=<%=a%>">复兴</a></td>
</tr>
</table>
</td>
</tr>
<tr>
<tdwidth="100%"valign="top"align="left"colspan="2"><%=rtrim(dbr("title"))%></td>
</tr>
<tr>
<tdwidth="100%"valign="top"align="left"colspan="2"><%=replace(server.htmlencode(rtrim(dbr("comm"))),chr(13),"<br>")%></td>
</tr>
<%dbr.movenext%>
<%ifdbr.EOFThenExitFor%>
<%next%>
<tr>
<tdalign="right"height="30"width="500"><ahref="index.asp?pagelist=<%=CINT(pagelist)+1%>"><spanclass="link">>>更多</span></td>
<tdalign="right"height="30"></td>
</tr>
</table>
<formmethod="POST"action="add.asp">
<tableborder="0"width="90%"cellspacing="0"cellpadding="0">
<tr>
<tdwidth="12%"class="title"><b>姓名:</b></td>
<tdwidth="88%">
<inputtype="text"name="name"size="30"class="name">
</td>
</tr>
<tr>
<tdwidth="12%"class="title"><b>E-mail:</b></td>
<tdwidth="88%">
<inputtype="text"name="email"size="30"class="box">
</td>
</tr>
<tr>
<tdwidth="12%"class="title"><b>标题:</b></td>
<tdwidth="88%">
<inputtype="text"name="title"size="30"class="box">
</td>
</tr>
<tr>
<tdwidth="12%"valign="top"class="title"><b>内容:</b></td>
<tdwidth="88%">
<textarearows="5"name="comm"cols="30"class="box"></textarea>
</td>
</tr>
<tr>
<tdwidth="12%"></td>
<tdwidth="88%">
<inputtype="image"border="0"name="imageField"src="http://www.163design.net/a/q/pic/send.gif"width="51"height="19">
</td>
</tr>
</table>
</form></div>
</body>
</html>
-----replay.asp---------
<%id=request("id")%>
<%setdbr=server.createobject("adodb.recordset")%>
<%dbr.open"select*fromforumwhere(id="&id&")",application("oledb"),1,1%>
<html>
<head>
<title>浮点论坛</title></head>
<bodybgcolor="#FFFCF0"leftmargin="0"topmargin="0"marginwidth="0"marginheight="0">
<divalign="center">
<formmethod="POST"action="add.asp">
<tableborder="0"width="90%"cellspacing="0"cellpadding="0">
<tr>
<tdwidth="12%"class="title"><b>姓名:</b></td>
<tdwidth="88%">
<inputtype="text"name="name"size="50"class="name">
</td>
</tr>
<tr>
<tdwidth="12%"class="title"><b>E-mail:</b></td>
<tdwidth="88%">
<inputtype="text"name="email"size="50"class="box">
</td>
</tr>
<tr>
<tdwidth="12%"class="title"><b>标题:</b></td>
<tdwidth="88%">
<inputtype="text"name="title"size="50"class="box"value="RE:<%=server.htmlencode(rtrim(dbr("title")))%>">
<inputtype="hidden"name="id"value="<%=request("id")%>">
</td>
</tr>
<tr>
<tdwidth="12%"valign="top"class="title"><b>内容:</b></td>
<tdwidth="88%">
<textarearows="5"name="comm"cols="48"class="box"></textarea>
</td>
</tr>
<tr>
<tdwidth="12%"></td>
<tdwidth="88%">
<inputtype="image"border="0"name="imageField"src="http://www.163design.net/a/q/pic/send.gif"width="51"height="19">
</td>
</tr>
</table>
</form></div>
<%dbr.close%>
<%setdbr=nothing%>
</body>
</html>
-------add.asp------
<%ifrequest("name")=""orreplace(request("title"),"RE:","")=""then%>
<html>
<head>
<title>浮点论坛</title></head>
<bodybackground="pic/bg_bbs.gif"leftmargin="0"topmargin="0"marginwidth="0"marginheight="0">
<divalign="center">
<tablewidth="450"border="0"cellspacing="0"cellpadding="0">
<tr>
<tdheight="60"class="title">姓名、题目不克不及为空</td>
</tr>
<tr>
<tdalign="center"height="30"><ahref="index.asp"class="link">前往</a></td>
</tr>
</table>
</div>
</body>
</html>
<%response.end%>
<%endif%>
<%setdbr=server.createobject("adodb.recordset")%>
<%ifrequest("id")=""then%>
<%dbr.open"selectmax(id)+1asmaxidfromforum",application("oledb"),1,1%>
<%tid=cint(dbr("maxid"))%>
<%dbr.close%>
<%dbr.open"selecttop0*fromforum",application("oledb"),1,3%>
<%
dbr.addnew
dbr("id")=tid
dbr("title")=request("title")
dbr("comm")=request("comm")
dbr("name")=request("name")
dbr("email")=request("email")
dbr("ip")=Request.ServerVariables("REMOTE_ADDR")
dbr("isdel")="n"
dbr("thedate")=cdate(now)
dbr.update
dbr.close
%>
<%setdbr=nothing%>
<%response.redirect("index.asp")%>
<%dbr.close%>
<%else%>
<%d=request("id")%>
<%dbr.open"SELECTTOP2*FROMforumWHERE(id<="&d&")ORDERBYidDESC",application("oledb"),1,1%>
<%ifdbr.recordcount=1then%>
<%inid=cdbl(dbr("id"))-(cdbl(dbr("id"))-0)/2%>
<%dbr.close%>
<%dbr.open"selecttop0*fromforum",application("oledb"),1,3%>
<%
dbr.addnew
dbr("id")=inid
dbr("title")=request("title")
dbr("comm")=request("comm")
dbr("name")=request("name")
dbr("email")=request("email")
dbr("ip")=Request.ServerVariables("REMOTE_ADDR")
dbr("isdel")="n"
dbr("thedate")=cdate(now)
dbr.update
dbr.close
%>
<%setdbr=nothing%>
<%response.redirect("index.asp")%>
<%elseifdbr.recordcount=2then%>
<%maxid=cdbl(dbr("id"))%>
<%dbr.movenext%>
<%minid=cdbl(dbr("id"))%>
<%dbr.close%>
<%inid=maxid-(maxid-minid)/2%>
<%=inid%>
<%dbr.open"selecttop0*fromforum",application("oledb"),1,3%>
<%
dbr.addnew
dbr("id")=inid
dbr("title")=request("title")
dbr("comm")=request("comm")
dbr("name")=request("name")
dbr("email")=request("email")
dbr("ip")=Request.ServerVariables("REMOTE_ADDR")
dbr("isdel")="n"
dbr("thedate")=cdate(now)
dbr.update
dbr.close
%>
<%setdbr=nothing%>
<%response.redirect("index.asp")%>
<%endif%>
<%endif%>

优点:简单易学、开发速度快、有很多年“历史”,能找到非常多别人做好的程序来用、配合activeX功能强大,很多php做不到的asp+activeX能做到,例如银行安全控件
莫相离 该用户已被删除
沙发
发表于 2015-1-20 08:47:15 | 只看该作者
ASP的语言不仅仅只是命令格式差不多,而是包含在<%%>之内的命令完全就是VB语法。虽然ASP也是做为单独的一个技术来提出的,但他就是完全继承了VB所有的功能。
老尸 该用户已被删除
板凳
发表于 2015-1-25 16:50:10 | 只看该作者
下面简单介绍一下我学习ASP的方法,希望对想学习ASP的朋友有所帮助...
谁可相欹 该用户已被删除
地板
发表于 2015-1-30 12:55:19 | 只看该作者
代码逻辑混乱,难于管理:由于ASP是脚本语言混合html编程,所以你很难看清代码的逻辑关系,并且随着程序的复杂性增加,使得代码的管理十分困难,甚至超出一个程序员所能达到的管理能力,从而造成出错或这样那样的问题。
第二个灵魂 该用户已被删除
5#
发表于 2015-2-6 11:55:26 | 只看该作者
弱类型造成潜在的出错可能:尽管弱数据类型的编程语言使用起来回方便一些,但相对于它所造成的出错几率是远远得不偿失的。
灵魂腐蚀 该用户已被删除
6#
发表于 2015-2-16 02:52:34 | 只看该作者
你可以通过继承已有的对象最大限度保护你以前的投资。并且C#和C++、Java一样提供了完善的调试/纠错体系。
爱飞 该用户已被删除
7#
发表于 2015-3-4 23:14:14 | 只看该作者
接下来就不能纸上谈兵了,最好的方法其实是实践。实践,只能算是让你掌握语言特性用的。而提倡做实际的Project也不是太好,因为你还没有熟练的能力去综合各种技术,这样只能使你自己越来越迷糊。
小女巫 该用户已被删除
8#
发表于 2015-3-11 21:20:15 | 只看该作者
完全不知道到底自己学的是什么。最后,除了教程里面说的几个例子,还是什么都不会。
精灵巫婆 该用户已被删除
9#
发表于 2015-3-19 13:55:32 | 只看该作者
他的语法和设计思路和VB完全相同,导致很多ASP的书都留一句“相关内容请参考VB的相关教材....”更糟糕的是,相当多的ASP教程混合了Javascript,VBscript等等脚本语言,搞的初学者。
海妖 该用户已被删除
10#
发表于 2015-3-28 06:40:41 | 只看该作者
弱类型造成潜在的出错可能:尽管弱数据类型的编程语言使用起来回方便一些,但相对于它所造成的出错几率是远远得不偿失的。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|仓酷云 鄂ICP备14007578号-2

GMT+8, 2024-5-15 05:58

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表