ASP 网页代码 大侠们帮忙注释一下,越详细越好。好的话另加50分

<!--#includefile="Inc/SysProduct.asp"--><%functioncutstr(tempstr,tempwid)iflen(tempst... <!--#include file="Inc/SysProduct.asp" -->
<%function cutstr(tempstr,tempwid)
if len(tempstr)>tempwid then
cutstr=left(tempstr,tempwid)&"..."
else
cutstr=tempstr
end if
end function%>
<!-- #include file="Head.asp" -->
<% call ShowSmallClass_Tree() %>
<%Set rsmenu = Server.CreateObject("ADODB.Recordset")
sql="select Content from culture where Title='left'"
rsmenu.open sql,conn,1,3%>
<%=rsmenu("Content")%>
<%rsmenu.close
set rsmenu=nothing
%>
<td align="middle" width="231" height="141"><img height="118" src="<%=WebmasterName%>" width="214" /></td>
<%Set rs = Server.CreateObject("ADODB.Recordset")
sql="select Content from Aboutus where Title='企业简介'"
rs.open sql,conn,1,3%>
<%=cutstr(rs("content"),260)%>
<%rs.close
rs=nothing%>
<%set rs_Product=server.createobject("adodb.recordset")
sqltext="select top " & Product_count & " * from Product where Passed=True and Elite=true order by UpdateTime desc"
rs_Product.open sqltext,conn,1,1
%>
<tr align="center">
<%If rs_Product.eof and rs_Product.bof then
response.write "<td><p align='center'><font color='#ff0000'>还没任何产品</font></p></td>"
else
row_count=1
Do While Not rs_Product.EOF%>
<img src=<%=rs_Product("DefaultPicUrl")%> width="170" height="140" border=0 >
<% if row_count mod 8 =0 then%>
</tr><tr>
<%end if%>
<%
rs_Product.MoveNext
row_count=row_count+1
Loop
end if
rs_Product.close
%>
这是部分代码。希望大虾们能看的懂!谢谢
展开
 我来答
百度网友f4f85e579
2011-05-13 · 超过13用户采纳过TA的回答
知道答主
回答量:37
采纳率:0%
帮助的人:27万
展开全部
<!--#include file="Inc/SysProduct.asp" -->
<%
'定义cutstr为字符串截取函数,tempstr为待截取字符串,tempwid为截取长度
'如果字符串超出截取长度,则截取规定长度后,后面补上“…”显示
else
function cutstr(tempstr,tempwid)
if len(tempstr)>tempwid then
cutstr=left(tempstr,tempwid)&"..."
cutstr=tempstr
end if
end function
%>
<!-- #include file="Head.asp" -->
<% call ShowSmallClass_Tree() '估计是调用分类显示函数 %>
<%Set rsmenu = Server.CreateObject("ADODB.Recordset")
'从数据库culture表中打开Title字段为"left"的记录,显示其"Content"字段
sql="select Content from culture where Title='left'"
rsmenu.open sql,conn,1,3%>
<%=rsmenu("Content")%>
<%rsmenu.close
set rsmenu=nothing
%>
<td align="middle" width="231" height="141"><img height="118" src="<%=WebmasterName%>" width="214" /></td>
<%Set rs = Server.CreateObject("ADODB.Recordset")
'从数据库Aboutus表中打开Title字段为"企业简介"的记录,显示其"Content"字段
sql="select Content from Aboutus where Title='企业简介'"
rs.open sql,conn,1,3%>
<%=cutstr(rs("content"),260) '显示时仅显示260字%>
<%rs.close
rs=nothing%>
<%set rs_Product=server.createobject("adodb.recordset")
'从数据库Product(产品)表中打开已通过审查(Passed=True)且标记为精华(Elite=true)的N条记录(N由Product_count决定)记录
sqltext="select top " & Product_count & " * from Product where Passed=True and Elite=true order by UpdateTime desc"
rs_Product.open sqltext,conn,1,1
%>
<tr align="center">
<%If rs_Product.eof and rs_Product.bof then '如果没有记录则显示“还没任何产品”
response.write "<td><p align='center'><font color='#ff0000'>还没任何产品</font></p></td>"
else
row_count=1
'循环显示N条记录的照片
Do While Not rs_Product.EOF%>
<img src=<%=rs_Product("DefaultPicUrl")%> width="170" height="140" border=0 >
<%'每8条记录的照片排一行
if row_count mod 8 =0 then%>
</tr><tr>
<%end if%>
<%
rs_Product.MoveNext
row_count=row_count+1
Loop
end if
rs_Product.close
%>
更多追问追答
追问


本人很菜,请问此段如何解释?又问rs是什么啊?谢谢
追答
是显示记录“Content”字段,和效果一样;rsmunu.close是关闭打开的数据记录,set rsmenu=nothing是清空rsmenu变量。在读写完数据库后一定要close,清空变量是为了优化程序运行占用资源情况。
百度网友98d91caef
2011-05-13 · TA获得超过109个赞
知道小有建树答主
回答量:181
采纳率:100%
帮助的人:109万
展开全部
这都是些基本的条件,循环以及SQL操作的代码,没什么好注释的啊,你不懂的话注释也不懂,建立你在ASP源码中心的文档中心搜索一些基础的ASP教程。
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式