一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

故事接龙10 viewcomment.asp

时间:2008-01-18 编辑:简简单单 来源:一聚教程网

<%@ Language=VBScript %>
>






投票结果:


<%
    set conn=server.CreateObject("adodb.connection")
    conn.ConnectionString="dsn=vote"
    conn.Open
    '按投票记数降序方式排列记录
    set mreturn=conn.Execute("select * from tbvote order by votecount desc")
    if not mreturn.bof then
    '如果存在投票记录
        '取得获得投票数最多的文章的文件名
        tempstr=mreturn("votechapter")
        phypath=server.MapPath("/project4_local")
        set fsys=server.CreateObject("scripting.filesystemobject")
        set txtfile=fsys.OpenTextFile(phypath & "/new1/" & tempstr,1)
        txtall=txtfile.readall
        pos1=instr(1,txtall,"",1)<br />        pos2=instr(1,txtall,"",1)
        '取得文章的标题
        title=mid(txtall,pos1+7,pos2-pos1-7)
        pos1=instr(1,txtall,"作者:")
        pos2=instr(pos1,txtall,"<")
        '取得文章作者的名字

热门栏目