Board logo

标题: 帮我解释一下代码 [打印本页]

作者: 饥喝    时间: 2005-5-19 17:30     标题: 帮我解释一下代码

<HTML> <HEAD> <TITLE> New Document </TITLE> </HEAD>

<BODY> <% dim cn,rs,i set cn=server.createobject("adodb.connection") cn.open "driver={sql server};server=qgm;database=asptest;uid=sa;pwd=woainiany#" set rs=server.createobject("adodb.recordset") rs.open "select * from chapter1",cn,1 if len(request("i"))=0 then i=1 else if request("type")= "next" then i=request("i")+1 for j=1 to i-1 if not rs.eof then rs.movenext next elseif request("type")="previous" then i=request("i")-1 for j=1 to i if not rs.eof then rs.movenext next if not rs.bof then rs.moveprevious elseif request("type")= "first" then i=1 rs.movefirst elseif request("type")="last" then i=3 rs.movenext end if end if %> <p align="center">µ±Ç°¼Ç¼λÖÃ<%=i%></p> <table border="1" bordercolor="#111111" cellpadding="0" cellspacing="0" width="336" align="center"> <tr> <td width="79">×¢²áID</td> <td width="79">×¢²áÃÜÂë</td> <td width="138">e-mailµØÖ·</td> </tr> <%if not rs.eof and not rs.bof then%> <tr> <td width="79"><%=rs(0)%></td> <td width="79"><%=rs(1)%></td> <td width="138"><%=rs(2)%></td> </tr> <%end if%> </table> <p align="center"> <%if i<>1 then%> <a href="08_03.asp?type=first&i=<%=i%>">movefirst</a> <%else%> movefirst <%end if%> <%if not rs.eof then%> <a href="08_03.asp?type=previous&i=<%=i%>">movenext</a> <%else%> movenext <%end if%> <%if not rs.bof then%> <a href="08_03.asp?type=previous&i=<%=i%>">moveprevious</a> <%else%> moveprevious <%end if%> <%if i<>3 then%> <a href="08_03.asp?type=last&i=<%=i%>">movelast</a> <%else%> movelast <%end if %> <% rs.close set rs=nothing cn.close set cn=nothing %> </BODY> </HTML>


作者: hxfly    时间: 2005-5-19 17:30


作者: 无根泉    时间: 2005-5-19 17:48

代码有问题,
作者: ASP菜菜菜鸟    时间: 2005-5-19 18:48

你想解释哪些。
作者: 盖茨他爹    时间: 2005-5-19 21:38

如果是MM
并且是漂亮MM
我会考虑逐行给解释
作者: 饥喝    时间: 2005-5-20 15:21

还能用你点什么呀,哎这年代真是的。
作者: 饥喝    时间: 2005-5-20 15:25

这些确实有点多,但对于一高手都是无所谓的,但对我一个菜鸟来说真太难了,如果能得到解释,我真的是太感动了! if len(request("i"))=0 then i=1 else if request("type")= "next" then i=request("i")+1 for j=1 to i-1 if not rs.eof then rs.movenext next elseif request("type")="previous" then i=request("i")-1 for j=1 to i if not rs.eof then rs.movenext next if not rs.bof then rs.moveprevious elseif request("type")= "first" then i=1 rs.movefirst elseif request("type")="last" then i=3 rs.movenext end if end if %> <p align="center">µ±Ç°¼Ç¼λÖÃ<%=i%></p> <table border="1" bordercolor="#111111" cellpadding="0" cellspacing="0" width="336" align="center"> <tr> <td width="79">×¢²áID</td> <td width="79">×¢²áÃÜÂë</td> <td width="138">e-mailµØÖ·</td> </tr> <%if not rs.eof and not rs.bof then%> <tr> <td width="79"><%=rs(0)%></td> <td width="79"><%=rs(1)%></td> <td width="138"><%=rs(2)%></td> </tr> <%end if%> </table> <p align="center"> <%if i<>1 then%> <a href="08_03.asp?type=first&i=<%=i%>">movefirst</a> <%else%> movefirst <%end if%> <%if not rs.eof then%> <a href="08_03.asp?type=previous&i=<%=i%>">movenext</a> <%else%> movenext <%end if%> <%if not rs.bof then%> <a href="08_03.asp?type=previous&i=<%=i%>">moveprevious</a> <%else%> moveprevious <%end if%> <%if i<>3 then%> <a href="08_03.asp?type=last&i=<%=i%>">movelast</a> <%else%> movelast <%end if %>




欢迎光临 编程论坛 (https://bbs.bccn.net/) Powered by Discuz! 6.1.0