
<%
  
sql = "select count(*) as num from 事件 "
set rs=conn.execute(sql)
num=rs("num")
tt=now()
if num>=40 then
do until num=40  '*
Set rs = Server.CreateObject("ADODB.recordset")
sql = "select top 1 * from 事件 order by 原因时间 asc"
rs.open sql,conn,3,2
rs.delete
num=num-1
rs.movenext
loop '*
end if

randomize
r=int(rnd*6000000)
sql = "select * from 股票 where 流通股票<="&r
set rs=conn.execute(sql)

DO while not RS.EOF
ming=rs("企业")
sql2="update 股票 set 流通股票=int(流通股票+6000000) where 企业='"&ming&"'"
conn.execute sql2
mess=""&ming&"加大上市股票数量。"
sql="insert into 事件(原因,原因时间) values('"&mess&"','"&tt&"' )"
conn.execute sql  
rs.movenext
LOOP
%>

<%
Randomize
rr=rnd
if rr>=0.6 then '4
if session("uname")="" then '3
response.redirect "err.asp"
else
session("myName")=request.cookies("aspsky")("username")
	username=Session.Contents("myName")




sql2="select count(*) as toto from 股票"   
set rsst=conn.execute(sql2)  
toto=rsst("toto")
rsst.close
Randomize
sj=int(toto*rnd)+1

sql= "select * from 股票 where sid="&sj        
set rs=conn.execute(sql)
if (rs("当前价格")-rs("开盘价格"))/rs("开盘价格")>=0.1 then '2
ming=rs("企业")        
sql="update 股票 set 当前价格=当前价格*0.93 where sid="&sj
conn.execute sql           
mess=""&ming&"的股票遭大户抛售，打开涨停状态！"
sql="insert into 事件(原因,原因时间) values('"&mess&"','"&tt&"' )"
conn.execute sql  

elseif (rs("当前价格")-rs("开盘价格"))/rs("开盘价格")<=-0.1 then
ming=rs("企业")
sql="update 股票 set 当前价格=当前价格*1.08 where sid="&sj
conn.execute sql              
mess=""&ming&"的股票被大量购入，打开跌停状态！"
sql="insert into 事件(原因,原因时间) values('"&mess&"','"&tt&"' )"
conn.execute sql  

else     
ming=rs("企业")     
Randomize
sj1=int(10*rnd)+1
if sj1>=1 and sj1<=3 then '1
sql="update 股票 set 当前价格=当前价格*"&(1-sj1/100)&" where sid="&sj
conn.execute sql 
mess=""&ming&"放出非利好消息，现价下滑 "&sj1&" %"
sql="insert into 事件(原因,原因时间) values('"&mess&"','"&tt&"' )"
conn.execute sql  
elseif sj1>=4 and sj1<=6 then
sql="update 股票 set 当前价格=当前价格*"&(1+sj1/100)&" where sid="&sj
conn.execute sql 
mess=""&ming&"大规模资产重组，现价上涨 "&sj1&" %"
sql="insert into 事件(原因,原因时间) values('"&mess&"','"&tt&"' )"
conn.execute sql  
elseif sj1>=7 and sj1<=8 then
sql="update 股票 set 当前价格=当前价格*"&(1-(10-sj1)/100)&" where sid="&sj
conn.execute sql 
mess=""&ming&"业绩大幅滑坡，现价下滑 "&(10-sj1)&" %"
sql="insert into 事件(原因,原因时间) values('"&mess&"','"&tt&"' )"
conn.execute sql  
else
sql="update 股票 set 当前价格=当前价格*"&(1+(sj1-8)/100)&" where sid="&sj
conn.execute sql 
mess=""&ming&"公司业绩提高，投资人信心加大，现价上涨 "&(sj1-8)&" %"
sql="insert into 事件(原因,原因时间) values('"&mess&"','"&tt&"' )"
conn.execute sql  
end if'1

end if '2
 end if     '3
           
    

	sj=formatdatetime(time(),3)
	sj="<font color=#FF00FF size=1>(" & sj & ")</font>"



end if '4

%>