最毒的气体:50分求助,商城菜单一例.
电脑类
键盘.显示器.光驱
显卡
书籍类
电子科技.读者.历史
NBA灌篮
但我不太清楚怎么实现的,谁能帮我解释一下其中的代码,尤其是if instr(rsprodtree("LarCode"),"*")= 0 then 这句是怎么用的,那个*号我找了前后文件也查不到,该怎么办?
<%
response.write "<table width='175' border='0' align='center' cellpadding=1 cellspacing=1>"
'分大类显示产品
Dim a,b,c '定义临时变量
sqllar="select Distinct LarCode,LarSeq,MidCode,MidSeq from ProdClass order by LarSeq,MIdSeq "
Set rsprodtree=Server.CreateObject("ADODB.RecordSet")
rsprodtree.Open sqllar,conn,1,1
if rsprodtree.bof and rsprodtree.eof then
response.write "<tr><td width=175 colspan="&tree_col&" height=100 align=center>您好!<br> 新的商城,商品准备中</td></tr>"
else
a=rsprodtree("LarCode")
Do While Not rsprodtree.eof
if instr(rsprodtree("LarCode"),"*")= 0 then '根据*号判断是否是屏蔽掉的类别大类
if (a<>b) then
response.write " <tr><td width=175 colspan="&tree_col&"><img height=3 src='images/line_0110.gif' width=175 align=bottom border=0></td></tr>"
response.write "<td width='175' bgcolor='#e7e7e7' class='dfont' height=20 colspan="&tree_col&"> <img src='images/arrow4.gif' width='11' height='13' border='0' align=absmiddle> "
response.write "<a href='sublist.asp?LarCode="&rsprodtree("LarCode")&"'>"&rsprodtree("LarCode")&"</a></td></tr>"
a=rsprodtree("LarCode")
else
end if
if instr(rsprodtree("MidCode"),"*")= 0 then '根据*号判断是否是屏蔽掉的类别中类
response.write "<tr>"
for i=0 to rsprodtree.recordcount
if i mod tree_col =0 and i<>0 then
response.write "</tr>"&vbcrlf&"<tr>"
response.write vbcrlf&"<TD class='dfont' onMouseOver=""bgColor='#FFE3D2'"" onMouseOut=""bgColor='#FFFBF7'""><a href='sublist.asp?LarCode="&rsprodtree("LarCode")&"&MidCode="&rsprodtree("MidCode")&"'><font color=#0066ff>"&rsprodtree("MidCode")&"</font></a></TD>"
else
response.write vbcrlf&"<TD class='dfont' onMouseOver=""bgColor='#FFE3D2'"" onMouseOut=""bgColor='#FFFBF7'""><a href='sublist.asp?LarCode="&rsprodtree("LarCode")&"&MidCode="&rsprodtree("MidCode")&"'><font color=#0066ff>"&rsprodtree("MidCode")&"</font></a></TD>"
end if
rsprodtree.movenext
if rsprodtree.eof then exit do
if a<>rsprodtree("LarCode") then
b=rsprodtree("LarCode")
exit for
end if
next
end if
end if
Loop
end if
set rsprodtree=nothing
response.write "</td></tr></table>"
%>
Do While Not rsprodtree.eof
response.write \"<tr><td width=\'175\' bgcolor=\'#e7e7e7\' class=\'dfont\' height=20 colspan=\"&tree_col&\">\"
response.write \"<a href=\'sublist.asp?LarCode=\"&rsprodtree(\"LarCode\")&\"\'>\"&rsprodtree(\"LarCode\")&\"</a></td></tr>\"
a=rsprodtree(\"LarCode\")
response.write \"<tr>\"
for i=0 to rsprodtree.recordcount
if i mod tree_col =0 and i<>0 then
response.write \"</tr>\"&vbcrlf&\"<tr>\"
response.write \"<TD><a href=\'sublist.asp?LarCode=\"&rsprodtree(\"LarCode\")&\"&MidCode=\"&rsprodtree(\"MidCode\")&\"\'>\"&rsprodtree(\"MidCode\")&\"</a></TD>\"
else
response.write \"<TD><a href=\'sublist.asp?LarCode=\"&rsprodtree(\"LarCode\")&\"&MidCode=\"&rsprodtree(\"MidCode\")&\"\'>\"&rsprodtree(\"MidCode\")&\"</a></TD>\"
end if
rsprodtree.movenext
if rsprodtree.eof then exit do
if a<>rsprodtree(\"LarCode\") then
exit for
end if
这个我式过不,可以用的,那个\"*\"我也去了,应该没什么用。
instr函数是查找字符串是否在另一个字符串的 若没有结果返回0
instr("字符串1","字符串2") //查找字符串2是否在字符串1中