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

📄 index.asp

📁 模拟炒股源码模拟炒股源码模拟炒股源码模拟炒股源码模拟炒股源码模拟炒股源码模拟炒股源码模拟炒股源码
💻 ASP
字号:
<%@ language=vbscript%>
<%response.expires=0%>
<%
if Session.Contents("UserName")="" then
%>
<html>
<head>
<script language="vbscript">
  MsgBox "不能进入,你还没有登录"
  location.href = "../index.htm"
</script>
<%
else
username=Session.Contents("UserName")
set conn=server.createobject("adodb.connection")
DBPath = Server.MapPath("stock.asp")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath
set uconn=server.createobject("adodb.connection")
DBPath = Server.MapPath("../../data/members.asp")
uconn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath
uconn.execute "update users set logwhere='股票交易所' where Name='"&username&"'"
uconn.execute "update users set logintime=Now() where Name='"&username&"'"

dim username,typename
username=Session.Contents("UserName")
set rs_s = server.createobject("adodb.recordset")
rs_s.cursorlocation=3
rs_s.open "select * from stock", conn,1,1
typename="股票交易所"
%>
<%
sql="select cash from users where name='"&username&"'"
set rs=server.createobject("adodb.recordset")
rs.cursorlocation=3
rs.open sql,uconn
nowmoney=rs("cash")
rs.close
set rs=nothing
%>
<link rel="stylesheet" href="../../CSS/STYLE.CSS">

<title></title>
<style type="text/css"><!--td {  font-family: 宋体; font-size: 9pt}body {  font-family: 宋体; font-size: 9pt}select {  font-family: 宋体; font-size: 9pt}A {text-decoration: none; font-family: "宋体"; font-size: 9pt}A:hover {text-decoration: underline; color: #CC0000; font-family: "宋体"; font-size: 9pt} .big {  font-family: 宋体; font-size: 10.8pt}
--></style>
<meta name="generator" content="Microsoft FrontPage 4.0">
</head>

<body>
<div align="center"><center>

    <table border="0" width="672" height="41" cellpadding="0" cellspacing="0">
      <tr> 
        <td width="164" height="16">&nbsp;</td>
</center>
        <td width="362" height="16" bgcolor="#005397" align="center"> 
          <p align="center"><font color="#FBE651" face="黑体" size="3"> 股 票 交  
            易 所</font>   
        </td>
      <center>

        <td width="140" height="16">&nbsp;</td>
      </tr>
    </table>
</center></div><table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr bgcolor="#FFFAE1"> 
    <td width="100%" height="20" bgcolor="#FFFFFF"><br>
      □- 今日大盘显示 -----今日成交总量<font  
    color="red"><%=amount()%></font>----- 每日股票行情评论、股民交流尽在<br>  
    □- 当某只股票的价格升幅为10%时涨停,此时只允许抛售股票;当某只股票的价格跌幅为10%时跌停,此时只允许购进股票</td>  
  </tr> 
</table> 
 
<table border="0" width="100%" cellspacing="1" cellpadding="2">
  <tr> 
    <td bgcolor="#005397" height="20" align="center" width="141"><font color="#FFFFFF">股票代号</font></td> 
    <td bgcolor="#005397" height="20" align="center" width="261"><font color="#FFFFFF">股票名称</font></td> 
    <td bgcolor="#005397" height="20" align="center" width="148"><font color="#FFFFFF">股票数量</font></td> 
    <td bgcolor="#005397" height="20" align="center" width="148"><font color="#FFFFFF">昨日价格</font></td> 
    <td bgcolor="#005397" height="20" align="center" width="148"><font color="#FFFFFF">今日价格</font></td> 
    <td bgcolor="#005397" height="20" align="center" width="113"><font color="#FFFFFF">成交量</font></td> 
        <td></td>
  </tr> 
<%  DO UNTIL RS_S.EOF  %> 
<%if CSng(rs_s("sprice_y"))<CSng(rs_s("sprice_t")) then  
    color="#FF0000"  
    elseif CSng(rs_s("sprice_y"))>Csng(rs_s("sprice_t")) then 
    color="#00FF00"  
    else 
    color="#FFFF00" 
    end if 
if (rs_s("sprice_t")/rs_s("sprice_y"))>1.1 then 
   sstop=1 
else 
   sstop=0 
end if 
 
  %> 
  <tr bgcolor="#006633"> 
    <td height="20" width="141" bgcolor="#D7D7D7" bordercolor="#FFFAE1"><%if sstop=1 then%> 
      <%=rs_s("sid")%><span class="p"><font color="#FF0000">(涨停)</font><font color="black"> <%else%>  
      </font> </span><a href="exchange.asp?sid=<%=rs_s("sid")%>"><span class="p"><font color="black"><%=rs_s("sid")%></font></span></a><font color="black"><span class="p"> <%end if%></span></font></td> 
    <td height="20" width="261" bgcolor="#D7D7D7"><font color="black">&nbsp;</font><a href="exchange.asp?sid=<%=rs_s("sid")%>"><font 
    color="<%=color%>"><%=rs_s("sname")%></font></a></td> 
<% 
    if rs_s("sshare")=0 then 
        randomize time() 
        addstocknum=int(rnd*2000+8000) 
        set addstock_rs=server.CreateObject("adodb.recordset") 
        addstock_sql="update stock set sshare='"&addstocknum&"' where sid='"&rs_s("sid")&"'" 
        addstock_rs.Open addstock_sql,conn,3,3 
      %> 
    <td height="20" width="148" bgcolor="#D7D7D7"><%=addstocknum%><font color="teal"><span class="p"> </span></font></td> 
<% 
    else 
    %> 
    <td height="20" width="148" bgcolor="#D7D7D7"><%=rs_s("sshare")%><font color="teal"><span class="p"> </span></font></td> 
<% 
    end if 
    %> 
    <td height="20" width="148" bgcolor="#D7D7D7"><%=formatnumber(rs_s("sprice_y"),3)%><font color="teal"><span class="p"> </span></font></td> 
    <td height="20" width="148" bgcolor="#D7D7D7"><%=formatnumber(rs_s("sprice_t"),3)%><font color="teal"><span class="p"> </span></font></td> 
    <td height="20" width="113" bgcolor="#D7D7D7"><%=rs_s("s_amount")%><font color="teal"><span class="p"> </span></font></td> 
  </tr> 
<% 
  RS_S.MoveNext 
  Loop 
  %> 
<%if session("uname")<>"guest" then%> 
</table> 
 
<table border="0" width="100%" cellspacing="0" cellpadding="0"> 
  <tr bgcolor="#FFFAE1">  
    <td width="100%" height="20" bgcolor="#FFFFFF">□- 下面是您拥有的股票<font color="red">↓</font>-----您有现金<font  
    color="red"><%=formatnumber(nowmoney,3)%></font>NG~~~快把你<a href="../BANK/index.asp"><font color="#0000FF">银行</font></a>的钱都取出来发财吧:)</td> 
  </tr> 
</table> 
 
<table border="0" width="100%" cellspacing="1" cellpadding="0"> 
  <tr bgcolor="#006633">  
    <td height="20" align="center" bgcolor="#0099CC"><font color="#FFFFFF">股票代号</font></td> 
    <td height="20" align="center" bgcolor="#0099CC"><font color="#FFFFFF">股票名称</font></td> 
    <td height="20" align="center" bgcolor="#0099CC"><font color="#FFFFFF">股票数量</font></td> 
    <td height="20" align="center" bgcolor="#0099CC"><font color="#FFFFFF">昨日价格</font></td> 
    <td height="20" align="center" bgcolor="#0099CC"><font color="#FFFFFF">今日价格</font></td> 
    <td height="20" align="center" bgcolor="#0099CC"><font color="#FFFFFF">成交量</font></td> 
    <td height="20" align="center" bgcolor="#0099CC"><font color="#FFFFFF">拥有数量</font></td> 
    <td height="20" align="center" bgcolor="#0099CC"><font color="#FFFFFF">平均价格</font></td> 
    <td height="20" align="center" bgcolor="#0099CC"><font color="#FFFFFF">买入时间</font></td> 
  </tr> 
  <% 
set rs_s=server.createobject("adodb.recordset") 
rs_s.cursorlocation=3 
rs_s.open"select * from stock,ustock where ustock.sid=stock.sid  and ustock.username='"&username&"'",conn 
 
do while not rs_s.eof  
if CSng(rs_s("sprice_y"))<CSng(rs_s("sprice_t")) then  
    color="#FF0000"  
    elseif CSng(rs_s("sprice_y"))>Csng(rs_s("sprice_t")) then 
    color="#00FF00"  
    else 
    color="#FFFF00" 
  end if 
if CSng(rs_s("sprice_t"))/CSng(rs_s("sprice_y"))>1.1 then 
   sstop=1 
else 
   sstop=0 
end if 
  %>  
  <tr bgcolor="#006633">  
    <td bgcolor="#D7D7D7"><%if sstop=1 then%> <%=rs_s("sid")%><span class="p"><font color="#FF0000">(涨停)</font>   
      <%else%> <a href="exchange.asp?sid=<%=rs_s("sid")%>&amp;uid=<%=username%>"><font color="black"><%=rs_s("sid")%></font></a>   
      <%end if%> </span></td>  
    <td bgcolor="#D7D7D7"><a 
    href="exchange.asp?sid=<%=rs_s("sid")%>&amp;uid=<%=username%>"><font color="black"><%=rs_s("sname")%></font></a></td> 
    <td bgcolor="#D7D7D7"><font color="<%=color%>"><%=rs_s("sshare")%></font></td> 
    <td bgcolor="#D7D7D7"><%=formatnumber(rs_s("sprice_y"),3)%> </td> 
    <td bgcolor="#D7D7D7"><%=formatnumber(rs_s("sprice_t"),3)%> </td> 
    <td bgcolor="#D7D7D7"><font color="<%=color%>"><%=rs_s("s_amount")%></font></td> 
    <td bgcolor="#D7D7D7"><font color="<%=color%>"><%=rs_s("ushare")%></font></td> 
    <td bgcolor="#D7D7D7"><%=formatnumber(rs_s("inprice"),3)%> </td> 
    <td bgcolor="#D7D7D7"><font color="<%=color%>"><%=rs_s("indate")%></font></td> 
  </tr> 
  <% 
rs_s.movenext 
loop 
%>  
</table> 
<% 
	end if 
end if 
set rs_s=Nothing 
 
function amount()  
dim rs  
    rs=conn.execute("Select sum(s_amount) As samount from stock")  
    amount=rs("samount")  
	set rs=nothing  
	if isnull(amount) then amount=0  
end function  
%> 
 
<p align="center"><a href="../../../asp/jmld.asp"><font color="#FF0000">我都看好了,回去了</font></a></p>
 
</body> 
</html> 
<%'conn.close 
'set conn=nothing 
'uconn.close 
'set uconn=nothing 
%> 
 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -