pollviewpoll.asp
来自「聊天室源码呵呵你好用~~~~~~2.0版本」· ASP 代码 · 共 116 行
ASP
116 行
<%@ LANGUAGE=VBScript%>
<%Server.ScriptTimeout=1000
Response.Expires=0
if Session("a_c_user_name")="" then
Response.write "<b>[操作失败]</b><p>您尚未登录(或已经超时退出),不能进行此操作!"
Response.end
end if
n=Year(date())
y=Month(date())
r=Day(date())
s=Hour(time())
f=Minute(time())
m=Second(time())
if len(y)=1 then y="0" & y
if len(r)=1 then r="0" & r
if len(s)=1 then s="0" & s
if len(f)=1 then f="0" & f
if len(m)=1 then m="0" & m
sj=n & "-" & y & "-" & r & " " & s & ":" & f & ":" & m
Set fs=CreateObject("Scripting.FileSystemObject")
pollfile=Server.Mappath("pollending.asp")
Set thisfile = fs.OpenTextFile(pollfile,1,False)
Dim poll()
count=0
do while not thisfile.AtEndOfStream
thisline=thisfile.Readline
Redim preserve poll(count)
poll(count)=thisline
count=count+1
loop
thisfile.close
if int(Session("a_c_user_value"))<int(poll(3)) then
Response.Write "<b>[操作失败]</b><p>您的经验值没有达到" & poll(3) & "分,不能投票。"
Response.End
end if
if Instr(poll(5)," "&Session("a_c_user_name")&" ")<>0 then
Response.Write "<b>[操作失败]</b><p>您已经投过票了,不能重复投票。"
Response.End
end if
if CDate(poll(1))>CDate(sj) then
Response.Write "<b>[操作失败]</b><p>投票活动尚未开始,不能投票。"
Response.End
end if
if CDate(poll(2))<CDate(sj) then
Response.Write "<b>[操作失败]</b><p>投票活动已经结束,不能投票。"
Response.End
end if
p=Server.HTMLEncode(Trim(Request.Form("poll")))
if p="" then
Response.Write "<b>[操作失败]</b><p>请选择您所支持的版主。<a href=javascript:history.go(-1)>【返回】</a>"
Response.End
end if
hxrcz=0
for i=6 to count-1 step 2
if poll(i)=p then
hxrcz=1
exit for
end if
next
if hxrcz=0 then
Response.Write "<b>[操作失败]</b><p>您支持的版主:<font color=red>" & p & "</font> 不存在。<a href=javascript:history.go(-1)>【返回】</a>"
Response.End
end if
set thisfile=fs.CreateTextFile(pollfile)
for i=0 to 3
thisfile.WriteLine poll(i)
next
thisfile.WriteLine poll(4)+1
thisfile.WriteLine poll(5)&Session("a_c_user_name")&" "
for i=6 to count-1 step 2
if poll(i)=p then
thisfile.WriteLine poll(i)
thisfile.WriteLine poll(i+1)+1
else
thisfile.WriteLine poll(i)
thisfile.WriteLine poll(i+1)
end if
next
set thisfile=nothing
set fs=nothing%><html>
<head>
<title>候选人管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type='text/css'>
<!--
.p9 {line-height: 150%; font-size: 9pt;}
.p12 {line-height: 150%; font-size: 12pt;}
body {line-height: 150%;font-size : 12pt;}
td {line-height: 135%;font-size : 10.5pt;}
A {text-decoration: none;}
A:Hover {text-decoration : none;}
a:visited { color: #0000FF}
-->
</style>
<script language="JavaScript">
function load()
{var name=navigator.appName
var vers=navigator.appVersion
if(name=="Netscape")
{window.location.reload()
}else
{history.go(0)
}}</script>
</head>
<body bgcolor="FFFFFF">
<h1 align="center"><font color="0099FF">【投票结果】</font></h1>
<hr noshade size="1" color=009900>
<p><b>[操作完成]</b></p>
<blockquote>
<p>感谢您投出这神圣的一票,您支持的是:<font color="#FF0000"><%=p%></font> <a href=javascript:history.go(-1)>【返回】</a></p>
</blockquote>
<hr noshade size="1" color=009900>
<div align="center" class="p9"><script src="use.asp"></script> <script src="sn.asp"></script><br><script src="copyright.asp"></script></div>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?