'=================================================
'过程名:ShowProduct
'=================================================
sub ShowProduct(TitleLen)
if TitleLen<0 or TitleLen>200 then
TitleLen=50
end if
    if currentpage<1 then
    currentpage=1
    end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
    currentpage= totalPut \ MaxPerPage
else
    currentpage= totalPut \ MaxPerPage + 1
end if
    end if
if currentPage=1 then
        sqlProduct="select top " & MaxPerPage
else
sqlProduct="select "
end if sqlProduct=sqlProduct & " ID,Product_Id,BigClassName,SmallClassName,IncludePic,Title,Price,Spec,Unit,Memo,DefaultPicUrl,UpdateTime,Hits from Product where Passed=True "

if BigClassName<>"" then
sqlProduct=sqlProduct & " and BigClassName='" & BigClassName & "' "
if SmallClassName<>"" then
sqlProduct=sqlProduct & " and SmallClassName='" & SmallClassName & "' "
end if
end if
sqlProduct=sqlProduct & " order by UpdateTime desc"
Set rsProduct= Server.CreateObject("ADODB.Recordset")
rsProduct.open sqlProduct,conn,1,1
if rsProduct.bof and  rsProduct.eof then
response.Write("<br><li>没有任何产品</li>")
else
if currentPage=1 then
call ProductContent(TitleLen)
else
if (currentPage-1)*MaxPerPage<totalPut then
              rsProduct.move  (currentPage-1)*MaxPerPage
          dim book
            book=rsProduct.book
             call ProductContent(TitleLen)
         else
         currentPage=1
            call ProductContent(TitleLen)
     end if
end if
end if
rsProduct.close
set rsProduct=nothing
end subsub ProductContent(intTitleLen)
       dim i,strTemp,ViewList
           i=1
 ViewList=3
strTemp=""
strtemp= strtemp & "<p>"
strTemp= strTemp & "<TABLE width='98%' align=center  BORDER=0 CELLSPACING=1 CELLPADDING=0>"
strTemp= strTemp & "<tr>"
do while not rsProduct.eof
 strTemp= strTemp & "<td>"
strTemp= strTemp & "<table align=center width=170 border=0 cellspacing=2 cellpadding=0>"
                strTemp= strTemp & "<tr>"
                strTemp= strTemp & "<td colspan=2>"
              strTemp= strTemp &"<TABLE  border=0 cellPadding=0 cellSpacing=5>" 
   strTemp= strTemp &"<TR>"
   strTemp= strTemp &"<TD align=middle > <TABLE align=center border=0 cellPadding=0 cellSpacing=0>"       
   strTemp= strTemp &"<TR>"
   strTemp= strTemp &"<TD  height=10><IMG height=10 src='Img/bg_0ltop.gif' width=10></TD>"
   strTemp= strTemp &"<TD background='Img/bg_01.gif' height=10></TD>"
   strTemp= strTemp &"<TD height=10><IMG height=10 src='Img/bg_0rtop.gif' width=10></TD>"
   strTemp= strTemp &"</TR>"
   strTemp= strTemp &"<TR> "
   strTemp= strTemp &"<TD background='Img/bg_03.gif' width=10>&nbsp;</TD>"
   strTemp= strTemp & "<td width=130 height=100>"&"<div align=center>"
   strTemp= strTemp & "<a href=ProductShow.asp?ID=" & rsProduct("id") & ">" & "<img src=" & rsProduct("DefaultPicUrl") & " width='180' height='130' border='0' >" & "</a><br></div>"  
   strTemp= strTemp & "</td>"
   strTemp= strTemp &"<TD background='Img/bg_04.gif' width=10>&nbsp;</TD>"
   strTemp= strTemp &"</TR>"
   strTemp= strTemp &"<TR>"
   strTemp= strTemp &"<TD height=10><IMG height=10 src='Img/bg_0lbottom.gif' width=10></TD>"
   strTemp= strTemp &"<TD background=Img/bg_02.gif height=10></TD>"
   strTemp= strTemp &"<TD height=10><IMG height=10 src='Img/bg_0rbottom.gif' width=10></TD>"
   strTemp= strTemp &"</TR>"          
   strTemp= strTemp &"</TABLE></TD>"
   strTemp= strTemp &"</TR>"  
   strTemp= strTemp &"</TABLE>"
                strTemp= strTemp & "</a></div></td>"
strTemp= strTemp & "</tr><tr>"
                strTemp= strTemp & "<td align=right >"
                strTemp= strTemp & "名称:</td>"
                strTemp= strTemp & "<td width=80% >"
                strTemp= strTemp & "<a href=ProductShow.asp?ID=" & rsProduct("id") & ">" & rsProduct("Title") & ""
                strTemp= strTemp & "</a></td>"

strTemp= strTemp & "</tr><tr>"
strTemp= strTemp & "<td align=right >"
                strTemp= strTemp & "编号:</td>"
                strTemp= strTemp & "<td>"
                strTemp= strTemp & rsProduct("Product_Id") & ""
                strTemp= strTemp & "</a></td>"       
   
                strTemp= strTemp & "</tr><tr>"
                strTemp= strTemp & "<td colspan=2>"
                strTemp= strTemp & "</td>"
                strTemp= strTemp & "</tr>" 
                strTemp= strTemp & "</table>"
        if i mod ViewList =0 then 
   strTemp= strTemp & "</td></tr>"
        end if
           rsProduct.MoveNext      
i=i+1
if i>MaxPerPage then exit do
loop
strtemp= strtemp & "</tr></table>"
response.write strTemp  
end sub对VB不感冒,求高手指教一下,现在网站每页显示的是10张图片,我要显示6张就行,每行3个,对于这俩个方法我应该怎么修改。谢谢了

解决方案 »

  1.   

    居然还有用VB拼接html来做网站的
      

  2.   

    caozhy帮我解决下,VB真不懂。嘿嘿。谢谢了
      

  3.   

    强烈建议楼主将strtemp这个变量在debug模式下输出,放到一个后缀为HTML的文件中,再编辑HTML文件,达到你的要求,最后,再按照最终的HTML文件内容调整VB代码。
      

  4.   

    楼主你搞错了吧,他这是个asp3里的vbs代码,你应该把它放在IIS里的ASP页面里运行看结果
      

  5.   

    只能upupupupupupupupupupupupupupupupupup