⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hqtgame02_103.asp

📁 此程序为网上下载
💻 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") <> "1" Then Msg "您尚未登录,不能进行游戏。"
If nickname = "" Then Msg "您尚未登录,不能进行游戏。"
If nickname = "聊天室管理员" Then Msg "不能以聊天室管理员的身份进行游戏。"
If Session("hxf_g_game02") = "" Then Response.Redirect "hqtgame02_100.asp"
game = Split(Session("hxf_g_game02"), "|")
card = Split(game(1), ",")
game(2) = Int(game(2))
game(3) = Int(game(3))
game(4) = Int(game(4))
If game(3) = 0 Then Response.Redirect "hqtgame02_102.asp"
If game(3) <= 21 And game(3) > game(4) Then
 Do While game(4) < game(3)
  game(4) = game(4) + CardNum(card(game(2) + 1))
  game(6) = game(6) & "," & card(game(2) + 1)
  game(2) = game(2) + 1
 Loop
End If
Function CardNum (v1)
 cnv = Left(v1, Len(v1) - 1)
 Select Case cnv
  Case "A"
   cnv = 1
  Case "J", "Q", "K"
   cnv = 10
  Case Else
   cnv = Int(cnv)
 End Select
 CardNum = cnv
End Function
Function CardShow (v1)
 csv = Replace(v1, "W", "<font color=black face=Symbol>&ordf;</font>")
 csv = Replace(csv, "X", "<font color=black face=Symbol>§</font>")
 csv = Replace(csv, "Y", "<font color=red face=Symbol>&copy;</font>")
 csv = Replace(csv, "Z", "<font color=red face=Symbol>¨</font>")
 csv = Replace(csv, ",", "<br>")
 CardShow = csv
End Function
Function RndRank (p_source, p_list, p_times)
 p_spsource = Split(p_source, p_list)
 ubp_spsource = UBound(p_spsource) + 1
 Randomize
 For p_i = 1 To p_times
  p_x1 = Int(Rnd * ubp_spsource)
  p_x2 = Int(Rnd * ubp_spsource)
  p_tempf1 = p_spsource(p_x1)
  p_spsource(p_x1) = p_spsource(p_x2)
  p_spsource(p_x2) = p_tempf1
 Next
 RndRank = Join(p_spsource, p_list)
End Function
zt = 0
If game(3) > 21 Or game(4) > game(3) And game(4) <= 21 Then
 zt = 0
 jg = "谢谢您,为聊天室捐资 " & game(0) & "¥ [" & game(3) & ":" & game(4) & "]"
 Session("hxf_g_game02") = ""
Else
 If game(3) = game(4) Then
  zt = 1
  jg = "出现平局,您可以免费重玩一局 [" & game(3) & ":" & game(4) & "]"
  Dim newgame(6)
  newgame(0) = game(0)
  newgame(2) = -1
  newgame(3) = 0
  newgame(4) = 0
  newgame(5) = ""
  newgame(6) = ""
  card = "AW,AX,AY,AZ,2W,2X,2Y,2Z,3W,3X,3Y,3Z,4W,4X,4Y,4Z,5W,5X,5Y,5Z,6W,6X,6Y,6Z,7W,7X,7Y,7Z,8W,8X,8Y,8Z,9W,9X,9Y,9Z,10W,10X,10Y,10Z,JW,JX,JY,JZ,QW,QX,QY,QZ,KW,KX,KY,KZ"
  card = RndRank(card, ",", 1000)
  newgame(1) = card
  Session("hxf_g_game02") = Join(newgame, "|")
 Else
  If game(3) > game(4) Or game(4) > 21 Then
   zt = 2
   jg = "恭喜您,获得奖金 " & Int(game(0)) * 2 & " ¥ [" & game(3) & ":" & game(4) & "]"
   Session("hxf_g_game02") = ""
  End If
 End If
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
 If zt = 2 Then
  zzfs = Int(game(0)) * 2
 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"))
  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 & "', '玩 21 点下注:<font color=red>" & game(0) & "¥</font>,牌局 [<font color=blue>" & game(3) & ":" & game(4) & "</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/hqtgame02.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(3) & ":" & game(4) & "]"
  thisfile.Close
  Set thisfile = Nothing
 Application.UnLock
 Set fs = Nothing
End If
%>
<html>
<head>
<title>二十一点</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="hqtgame02_102.asp" onSubmit="return(check())">
<td>
<table border="0" align="center" cellspacing="3" cellpadding="3" width="80%">
<tr align="center" bgcolor="red"> 
<td colspan="3"><big><font color="#FFFFFF"><%=jg%></font></big></td>
</tr>
<tr align="center"> 
<td bgcolor="#EEEEFF">&nbsp;</td>
<td bgcolor="#FFFFFF">人 方</td>
<td bgcolor="EEEEFF">机 方</td>
</tr>
<tr align="center"> 
<td bgcolor="#EEEEFF">总点数:</td>
<td bgcolor="#FFFFFF"><font color=red><big><b><%=game(3)%></b></big></font> 点</td>
<td bgcolor="EEEEFF"><font color=red><big><b><%=game(4)%></b></big></font> 点</td>
</tr>
<tr align="center"> 
<td bgcolor="#EEEEFF">牌 面:</td>
<td bgcolor="#FFFFFF" valign="top"><big><%=CardShow(game(5))%></big></td>
<td bgcolor="EEEEFF" valign="top"><big><%=CardShow(game(6))%></big></td>
</tr>
<tr align="center">
<td colspan="3">&nbsp;</td>
</tr>
<tr align="center"> 
<td colspan="3"> 
<%If zt <> 1 Then%><input type="button" name="Conplay" value="继续再玩(C)" accesskey="c" onClick="JavaScript:top.location.replace('hqtgame02_100.asp')">
<input type="button" name="Exit" value="我不玩了(Q)" onClick="JavaScript:top.window.close()">
<%Else%><input type="button" value="免费重玩(R)" name="Replay" onClick="JavaScript:top.location.replace('hqtgame02_102.asp')">
<%End If%>
</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 + -