<%@ Language=vbscript%>
<HTML>
<HEAD>
<meta name= "generator" content= "Microsoft Visual Studio 6.0" >
</HEAD>
<BODY>
<form action= "new.asp" Target=mainframe method=post id=form1 name=form1>
<P>
Voting Results:</p>
<%
Set Conn=server. CreateObject ("Adodb.connection")
Conn. Connectionstring= "Dsn=vote"
Conn. Open
' Sort records in descending order of votes
Set Mreturn=conn. Execute ("SELECT * from Tbvote ORDER by votecount Desc")
If not Mreturn.bof then
' If there is a voting record
' Get the name of the article that gets the most votes
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, "<title>", 1)
Pos2=instr (1,txtall, "</title>", 1)
' Get the title of the article
Title=mid (txtall,pos1+7,pos2-pos1-7)
Pos1=instr (1,txtall, "Author:")
Pos2=instr (Pos1,txtall, "<")
' Get the name of the author of the article
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.