• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
    • 軟件測試技術
    • 軟件測試博客
    • 軟件測試視頻
    • 開源軟件測試技術
    • 軟件測試論壇
    • 軟件測試沙龍
    • 軟件測試資料下載
    • 軟件測試雜志
    • 軟件測試人才招聘
      暫時沒有公告

    字號: | 推薦給好友 上一篇 | 下一篇

    用文本+ASP打造新聞發布系統(三)新聞列表顯示

    發布: 2007-7-14 19:37 | 作者: 佚名    | 來源: 網絡轉載     | 查看: 14次 | 進入軟件測試論壇討論

    領測軟件測試網 <%
    dim myfso,myread
    set myfso=createobject("scripting.filesystemobject")
    set myread=myfso.opentextfile(server.mappath("./new_list.asp"),1,0)

    if myread.atendofstream then
    Response.Write "目前沒有添加新聞"
    Response.End
    else

    dim mytext,listarray
    mytext=myread.readall
    listarray=split(mytext,"|") '#######把所有記錄分割成一個數組a

    dim recordcount,pagecount, pagesize, pagenum
    recordcount=ubound(listarray)'############記錄條數
    pagesize=2
    pagecount=recordcount/pagesize '#######取得頁面數
    if instr(1,pagecount,".")=null or instr(1,pagecount,".")=0 then
    pagenum=pagecount
    else
    pagenum=int(pagecount)+1
    end if

    dim topage
    topage=cint(Request.QueryString ("topage")) '########取得要顯示的頁面
    if topage<=0 then
    topage=1
    end if
    if topage>pagenum then
    topage=pagenum
    end if


    dim i,j,n
    b=listarray
    for i=0 to recordcount-1 '########把每一條記錄組成一個數組
    j=split(listarray(i),",")
    if ubound(j)=6 then
    b(i)="<SPAN style='COLOR: #ffbd00; FONT-SIZE: 7px'><li></SPAN><span style='font-size:10pt'><a href='news_view.asp?id=" & j(0) & "' target=blank>" & j(1) & "(圖)</a> 點擊:" & j(4)&"次 最后發布時間:"&j(5)&"</span>"
    else
    b(i)="<SPAN style='COLOR: #ffbd00; FONT-SIZE: 7px'><li></SPAN><span style='font-size:10pt'><a href='news_view.asp?id=" & j(0) & "' target=blank>" & j(1) & "</a> 點擊:" & j(4)&"次 最后發布時間:"&j(5)&"</span>"
    end if
    next

    '########把記錄反排序存儲在新的數組實現按時間反排序
    dim c(100)
    n=0
    for i=recordcount to 0 step -1
    c(n)=b(i)
    n=n+1
    next


    dim currentrecord
    currentrecord=pagesize*(topage-1)+1 '#########顯示每一頁
    for k=1 to pagesize
    if len(c(currentrecord))=0 then
    exit for
    end if
    Response.Write c(currentrecord)&"<br>"
    currentrecord=currentrecord+1
    next
    Response.Write "<body bgcolor=#EDF0F5 topmargin=10 marginheight=5 leftmargin=4 marginwidth=0>"
    for m=1 to pagenum
    response.write "<span style=font-size:10pt><a href=news_list.asp?topage="&m&">"&m&"</a></span> "
    next

    end if

    %>


    延伸閱讀

    文章來源于領測軟件測試網 http://www.kjueaiud.com/


    關于領測軟件測試網 | 領測軟件測試網合作伙伴 | 廣告服務 | 投稿指南 | 聯系我們 | 網站地圖 | 友情鏈接
    版權所有(C) 2003-2010 TestAge(領測軟件測試網)|領測國際科技(北京)有限公司|軟件測試工程師培訓網 All Rights Reserved
    北京市海淀區中關村南大街9號北京理工科技大廈1402室 京ICP備2023014753號-2
    技術支持和業務聯系:info@testage.com.cn 電話:010-51297073

    軟件測試 | 領測國際ISTQBISTQB官網TMMiTMMi認證國際軟件測試工程師認證領測軟件測試網

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>