|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
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能做到,例如银行安全控件 |
|