<%@ Language=VBScript %>
<%
'定义用于从给定文件读取票数的函数:
Function ReadCount(CFile)
Dim objFSO,objTS
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objTs = objFSO.OpenTextFile(Server.MapPath(CFile),1,True)
If Not objTS.AtEndOfStream Then
ReadCount = CLng(objTS.ReadLine)
幼小衔接图片
El
ReadCount = 0
End If
objTS.Clo
Set objFSO=Nothing
End Function
'定义用于将累计票数写入指定文件的Sub过程:
Sub WriteCount(CFile,Count)
Dim objFSO,objTS
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objTS = objFSO.OpenTextFile(Server.MapPath(CFile),2,True)
objTS.WriteLine(Count)
屈打成招的意思 objTS.Clo
Set objFSO=Nothing
End Sub
炸丸子%>
<%
Dim Vote,London1,Paris1,Sanfran1
'锁定Application变量:
Application.Lock
'获取浏览者所投票的城市:
Vote = Request("Vote")
'从相应文件分别读取个城市已获得的票数:
London1 = ReadCount("")
Paris1 = ReadCount("")
Sanfran1 = ReadCount("")dnf解除安全模式官网
'判断当前得票的城市,并为其票数加1后写入对应文件:
If Vote="London" Then
London1=London1+1
越的成语 WriteCount "",London1
ElIf Vote="Paris" Then
Paris1=Paris1+1
WriteCount "",Paris1
ElIf Vote="Sanfran" Then
Sanfran1=Sanfran1+1
WriteCount "",Sanfran1
End If
'解除对Application变量的锁定:
Application.UnLock
%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; chart=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>魅力城市网上投票</title>
</head>
地理怎么才能学好<body bgcolor="#3366FF">
<p align="center">
<img border="0" src="poll.jpg" width="413" height="80"></p>
<div align="center">
<table border="0" width="440" height="138">
<tr>
<td width="33%" height="96"><a href="poll.asp?Vote=London">
<img border="0" src="LONDON.GIF" width="101" height="87">
</a></td>
<td width="33%" height="96"><a href="poll.asp?Vote=Paris">
<img border="0" src="PARIS.GIF" width="100" height="95">
</a></td>
<td width="34%" height="96"><a href="poll.asp?Vote=Sanfran">
<img border="0" src="SANFRAN.GIF" width="101" height="88">
</a/></td>
</tr>
<tr>
<td width="33%" height="33"><font color="#FFFFFF" size="4">
伦敦得票数:<% = London1 %></font></td>
<td width="33%" height="33"><font color="#FFFFFF" size="4">
巴黎得票数:<% = Paris1 %></font></td>
<td width="34%" height="33"><font color="#FFFFFF" size="4">布艺沙发怎么清洗
旧金山得票数:<% = Sanfran1 %></font></td>
</tr>
</table>
</div>
<p align="center"><font face="楷体_GB2312" size="4">
请用鼠标点击一下您所喜欢的城市图片,</font></p>
<p align="center"><font face="楷体_GB2312" size="4">
该市就可获得您宝贵的一票!</font></p>
兴教寺塔
</body>
</html>