程序代码:
<table width="190" border="0" align="center" cellpadding="0" cellspacing="0">
<%
strcode=""
for i=1 to Len(SourCode) \ 4
strcode=strcode&" or c_code like '"&left(SourCode,i*4)&"____'"
next
if strcode<>"" then
strcode="(1<>1"&strcode&" or Len(c_code)=4)"
else
strcode=" Len(c_code)=4"
end if
strSQL="Select * From web_news_class Where 1=1 and " & strcode & " Order by c_code"
'response.Write(strsql)
Set rs=Server.CreateObject("ADODB.RecordSet")
rs.open strSQL,conn,1,1
for i=1 to rs.recordcount
Level=(Len(rs("c_code"))/4-1)*3
If Len(rs("c_code"))>4 then
mefeekk="this.className='highlight1'"
else
mefeekk="this.className='highlight'"
end if
%>
<% If Len(rs("c_code"))>4 Then %>
<tr>
<td height="25" bgcolor="#FFFFFF" >
<% select case Len(rs("c_code"))
case 12
%>
<% case 16 %>
<% end select %>
<% bpk=conn.execute("select count(*) from [web_news_class] where c_name='"&rs("c_name")&"'")(0) %>
<a href="product.asp?class=<%=rs("id")%>&classname=<%=trim(rs("c_name"))%>"><% If bpk>0 Then %><IMG src="image/11111.gif" width="20" height="19" border=0 align="absbottom"><% Else %><img src="pic/05.gif">
<% End If %>
<%=trim(rs("c_name"))%></a> </td></tr>
<% Else %>
<tr>
<td height="25" bgcolor="#FFFFFF" class="w2" >