📄 hqtgame04_103.asp
字号:
<%@ LANGUAGE=VBScript codepage ="936" %>
<%
Response.Buffer = True
Response.Expires = 0
Response.CacheControl = "Private"
Sub Msg (v)
Response.Write "<html><head><meta http-equiv='Content-Type' content='text/html; charset=gb2312'><title>猜数游戏</title><meta http-equiv='pragma' content='no-cache'><style type=text/css>body{color:black;font-family:宋体;font-size:9pt;background-color:buttonface;border-bottom:medium none;border-left:medium none;border-right:medium none;border-top:medium none;padding-bottom:0px;padding-left:0px;padding-right:0px;padding-top:0px}</style></head><body leftMargin=0 topMargin=0 marginheight=0 marginwidth=0>"
Response.Write "<script Language=JavaScript>alert('" & v & "');window.close();</script></body></html>"
Response.End
End Sub
userip=Request.ServerVariables("REMOTE_ADDR")
nickname=Session("hxf_u_nickname")
If Session("hxf_u_inthechat") = "" Then Msg "您尚未登录,不能进行游戏。"
If nickname = "" Then Msg "您尚未登录,不能进行游戏。"
If nickname = "聊天室管理员" Then Msg "不能以聊天室管理员的身份进行游戏。"
If Session("hxf_g_game04") = "" Then Response.Redirect "hqtgame04_100.asp"
game = Split(Session("hxf_g_game04"), "|")
game(0) = Int(game(0))
game(1) = Int(game(1))
game(2) = Int(game(2))
If game(2) = 0 Then Response.Redirect "hqtgame04_102.asp"
ccjg = game(2) + 2
If game(ccjg) = "" Then Response.Redirect "hqtgame04_102.asp"
If game(2) < 4 And Int(game(1)) <> Int(game(ccjg)) Then Response.Redirect "hqtgame04_102.asp"
zt = 0
If Int(game(1)) <> Int(game(ccjg)) Then
zt = 0
jg = "谢谢您,为聊天室捐资 " & game(0) & "¥"
Session("hxf_g_game04") = ""
Else
zt = 1
Select Case game(2)
Case 1
bs = 8
Case 2
bs = 4
Case 3
bs = 2
Case 4
bs = 1
End Select
jg = "恭喜您,获得奖金 " & game(0) * bs & " ¥"
Session("hxf_g_game04") = ""
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
zzfs = 0
If zt = 1 Then
zzfs = game(0) * bs
Set conn=Server.CreateObject("ADODB.CONNECTION")
Set rs=Server.CreateObject("ADODB.RecordSet")
connstr=Application("wsaxhg_connstr")
conn.open connstr
sql = "SELECT hb FROM reginfo WHERE kill = '0' AND username = '" & nickname & "'"
rs.open sql, conn, 1, 3
If rs.Eof And rs.Bof Then
rs.Close
conn.Close
Set rs = Nothing
Set conn = Nothing
Msg "用户名“" & nickname & "”不存在,不能进行游戏!"
End If
huobi = Int(rs("hb"))
huan = 0
If huobi < 0 Then
If zzfs <= Abs(huobi) Then
huan = zzfs
Else
huan = Abs(huobi)
End If
End If
huobi = huobi + zzfs
rs("hb") = huobi
rs.Update
rs.Close
Session("hxf_u_hb") = huobi
sql = "SELECT value FROM system WHERE name='chatmoney'"
rs.open sql, conn, 1, 3
chatmoney = Int(rs("value")) - zzfs
rs("value") = chatmoney
rs.Update
rs.Close
Application.Lock
Application("wsaxhxf_c_chatmoney") = chatmoney
Application.UnLock
sql = "INSERT INTO logs (type, logtime, name, ip, opertion) VALUES ('1', '" & sj & "', '" & nickname & "', '" & userip & "', '猜数下注:<font color=red>" & game(0) & "¥</font>,第 [<font color=blue>" & game(2) & "</font>] 次猜中,获得奖金:<font color=red>" & zzfs & "¥</font>。')"
conn.Execute sql
conn.Close
Set rs = Nothing
Set conn = Nothing
End If
Set fs = Server.CreateObject("Scripting.FileSystemObject")
fnpath = Server.MapPath("log/hqtgame04.txt")
Application.Lock
If fs.FileExists(fnpath) Then
Set thisfile = fs.OpenTextFile(fnpath, 8)
Else
Set thisfile = fs.CreateTextFile(fnpath, 1, False)
End If
thisfile.writeline "[" & sj & "] [" & nickname & "] [" & game(0) & "] [" & zzfs & "] [" & game(1) & "] [" & game(2) & "次] [" & game(3) & "|" & game(4) & "|" & game(5) & "|" & game(6) & "]"
thisfile.Close
Set thisfile = Nothing
Application.UnLock
Set fs = Nothing
%>
<html>
<head>
<title><%=Application("wsaxhxf_c_chatroomname")%>-猜数游戏</title>
<meta http-equiv='Content-Type' content='text/html; charset=gb2312'>
<style type=text/css>
body{color:black;font-family:宋体;font-size:9pt;background-color:buttonface;border-bottom:medium none;border-left:medium none;border-right:medium none;border-top:medium none;padding-bottom:0px;padding-left:0px;padding-right:0px;padding-top:0px}
td{font-family:宋体;font-size:9pt;}
input{font-family:宋体;font-size:9pt;}
textarea{font-family:宋体;font-size:9pt;}
a{font-family:'宋体';color:blue;text-decoration:none}
a:hover{font-family:'宋体';color:blue;text-decoration:underline}
</style>
</head>
<body leftMargin=0 topMargin=0 marginheight=0 marginwidth=0>
<table border="0" align="center" width="100%" height="100%">
<tr>
<form method="post" name="send" action="hqtgame04_102.asp" onSubmit="return(check())">
<td>
<table border="0" align="center" cellspacing="3" cellpadding="3" width="80%">
<tr align="center">
<td colspan="3" bgcolor="red"><big><font color="#FFFFFF"><%=jg%></font></big></td>
</tr>
<tr align="center">
<td bgcolor="#EEEEFF">猜测次数</td>
<td bgcolor="#FFFFFF">猜测的数</td>
<td bgcolor="EEEEFF">结果</td>
</tr>
<%
For i = 1 To game(2)
%>
<tr align="center">
<td bgcolor="#EEEEFF">第 <%=i%> 次</td>
<td bgcolor="#FFFFFF"><font color=009900><big><b><%=game(i + 2)%></b></big></font></td>
<td bgcolor="EEEEFF">
<%
If Int(game(i + 2)) > Int(game(1)) Then Response.Write "<font color=red>大了</font>"
If Int(game(i + 2)) < Int(game(1)) Then Response.Write "<font color=blue>小了</font>"
If Int(game(i + 2)) = Int(game(1)) Then Response.Write "<font color=red>对啦!</font>"
%>
</td>
</tr>
<%
Next
%>
<tr align="center">
<td colspan="3">目标数值是:<big><font color="red"><%=game(1)%></font></big>。</td>
</tr>
<tr align="center">
<td colspan="3">
<input type="button" name="Conplay" value="继续再玩(C)" accesskey="c" onClick="JavaScript:top.location.replace('hqtgame04_100.asp')">
<input type="button" name="Exit" value="我不玩了(Q)" onClick="JavaScript:top.window.close()">
</td>
</tr>
</table>
</td>
</form>
</tr>
</table>
<div id='dh' style="position:absolute; left:-800px; top:-800px; width:0px; height:0px; z-index:1">
<input type=button value='-' name='goppp' onclick='Javascript:window.close();' accesskey='q'>
</div>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -