Ajax画(根据数据库画图连续的哦~~)的小程序(在回首- -)

本文介绍了一个使用JavaScript进行股市图表绘制的方法,通过与服务器交互获取实时数据并动态更新图表。该实现利用HTML表格元素来模拟画布效果,展示了如何根据数据变化调整坐标轴及绘制折线。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

今天本想继续写~加班太累了哈~~放个翻出毕业设计的一部分分享下赫赫14.gif
首先根据数据服务器后台管理得到状态是否画图,如果要画图则有服务器后台提供,绘图后台数据,

这个画图的方法是用javascript在层上绘span。



ExpandedBlockStart.gifContractedBlock.gif<%dot.gif@ Page CodeBehind="股市图.aspx.cs" Language="c#" AutoEventWireup="false" Inherits="测试隐藏刷新.WebForm10" %>
None.gif
<HTML>
None.gif    
<head>
None.gif        
<meta http-equiv="Content-Type" content="text/html;   charset=gb2312">
ExpandedBlockStart.gifContractedBlock.gif        
<script language="JavaScript">dot.gif
InBlock.gif
var   rs="";
InBlock.gif
var   x0=0//x轴启时点
InBlock.gif
var   x1=0//x轴结束点
InBlock.gif
var   y0=100
InBlock.gif
var   y1=100
InBlock.gif
var size//宽度
InBlock.gif
var str=""
InBlock.gif
InBlock.gif
//var a=0
InBlock.gif
var i=0
InBlock.gif
var tempy=0//画x 轴y轴时用的
InBlock.gif
var tempx=0
InBlock.gif
var Open ="Start"//这个是程序的状态,包括start--启动时初始划数据,runtime--运行时
InBlock.gif
var Input=Open
InBlock.gif
var start=""
InBlock.gif
function GetData() 
ExpandedSubBlockStart.gifContractedSubBlock.gif
dot.gif
InBlock.gif
InBlock.gif
var http = new ActiveXObject("Microsoft.XMLHTTP"); 
InBlock.gifhttp.open(
"POST","Server.aspx?t="+escape(Input),false);
InBlock.gifhttp.send(); 
InBlock.gif str 
= unescape(http.responseText); 
InBlock.gif
var SetupTemp = new Array();//得到设置的数组
InBlock.gif

InBlock.gif    SetupTemp 
= str.split(",");
InBlock.gif
if(Open=="Start")//启动状态--第一次启动绝对进入该状态
ExpandedSubBlockStart.gifContractedSubBlock.gif
dot.gif{
InBlock.gif    
if(SetupTemp[0]=="pleaseWaitdot.gifdot.gif")//如果会传的数据为pleaseWaitdot.gifdot.gif那么就代表服务器还没有设置数据
ExpandedSubBlockStart.gifContractedSubBlock.gif
    dot.gif{
InBlock.gif        cs.innerHTML
="服务器未启动请稍等";
ExpandedSubBlockEnd.gif    }

InBlock.gif    
else
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{
InBlock.gif    
//请注意不能在这里画太多的象素
InBlock.gif

InBlock.gif        cs.innerHTML
=cs.innerHTML+drawLine(0,5,0,500,"blue",4);//画左竖线
InBlock.gif
        cs.innerHTML=cs.innerHTML+drawLine(0,499,1510,499,"blue",4);//画下低横线
InBlock.gif
        tempy=470/10
InBlock.gif        
for(i;i<11;i++)//画左竖线的刻度尺
ExpandedSubBlockStart.gifContractedSubBlock.gif
        dot.gif{
InBlock.gif            
if(i==5)//设置中心点
ExpandedSubBlockStart.gifContractedSubBlock.gif
            dot.gif{
InBlock.gif                
InBlock.gif            
InBlock.gif                y0
=tempy*i+26//设置画折线的起始位置未当前上政指数就是刚刚开盘的时候
InBlock.gif
                y1=tempy*i+26
InBlock.gif                
InBlock.gif                cs.innerHTML
=cs.innerHTML+drawLineAddString(3,tempy*i+10,5,tempy*i+10,"shamrock`",1,SetupTemp[0])//,SetupTemp[0]上政指数
ExpandedSubBlockEnd.gif
            }

InBlock.gif            
else if(i<5)//画上半区刻度
ExpandedSubBlockStart.gifContractedSubBlock.gif
            dot.gif{
InBlock.gif            cs.innerHTML
=cs.innerHTML+drawLineAddString(3,tempy*i+10,5,tempy*i+10,"shamrock`",1,SetupTemp[0]*(11-i))
ExpandedSubBlockEnd.gif            }

InBlock.gif            
else//画下半区刻度
ExpandedSubBlockStart.gifContractedSubBlock.gif
            dot.gif{
InBlock.gif                        cs.innerHTML
=cs.innerHTML+drawLineAddString(3,tempy*i+10,5,tempy*i+10,"shamrock`",1,"")
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

InBlock.gif        tempx
=1000/15//画x轴刻度
InBlock.gif
        cs.innerHTML=cs.innerHTML+drawLineAddString(tempx*2,500-20,tempx*2,500-20,"shamrock`",4,1)
InBlock.gif        cs.innerHTML
=cs.innerHTML+drawLineAddString(tempx*4,500-20,tempx*4,500-20,"shamrock`",4,2)
InBlock.gif        cs.innerHTML
=cs.innerHTML+drawLineAddString(tempx*6,500-20,tempx*6,500-20,"shamrock`",4,"Stop")//停盘
InBlock.gif
        cs.innerHTML=cs.innerHTML+drawLineAddString(tempx*8,500-20,tempx*8,500-20,"shamrock`",4,3)
InBlock.gif        cs.innerHTML
=cs.innerHTML+drawLineAddString(tempx*10,500-20,tempx*10,500-20,"shamrock`",4,4)
InBlock.gif        
InBlock.gif        
InBlock.gif        
//---画可能的初始化数据---如果不是在开盘时进入那么就必须画出开盘后到现在的线
InBlock.gif
        
InBlock.gif        
for(i=1;i<SetupTemp.length;i++)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif        
InBlock.gif            
InBlock.gif            setXOry(SetupTemp[i])
InBlock.gif            canvas.innerHTML
=canvas.innerHTML+drawLine(x0,y0,x1,y1,"red",3);
InBlock.gif            
ExpandedSubBlockEnd.gif        }

InBlock.gif        
InBlock.gif        Input
="0"
InBlock.gif        Open
="runtime"//处于运行时状态
ExpandedSubBlockEnd.gif
        }

ExpandedSubBlockEnd.gif}

InBlock.gif
else//有数据返回就可以画
ExpandedSubBlockStart.gifContractedSubBlock.gif
dot.gif{
InBlock.gif
InBlock.gif    
InBlock.gif
InBlock.gif
InBlock.gif
for(i=0;i<SetupTemp.length;i++)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
//setXOry(SetupTemp[i])
InBlock.gif

InBlock.gif    
//实现了向下探1次平衡,向下探2次平横
InBlock.gif
    if(y0<496)//向下传投到x轴0点的时候不能在向下走
ExpandedSubBlockStart.gifContractedSubBlock.gif
    dot.gif{
InBlock.gif    
//在这里向下穿透不要调用1就可以不再画了
InBlock.gif
    //canvas.innerHTML=canvas.innerHTML+SetupTemp[0].valueOf()+"1<br>";
InBlock.gif
    
InBlock.gif    setXOry(SetupTemp[i].valueOf())
//直接调整画线坐标的函数//参数代表影响折线位置的 0-平,1-降-2升
ExpandedSubBlockEnd.gif
    }

InBlock.gif     
if(x1<1500)//x轴未走到头的花可以继续走
ExpandedSubBlockStart.gifContractedSubBlock.gif
    dot.gif{
InBlock.gif        canvas.innerHTML
=canvas.innerHTML+drawLine(x0,y0,x1,y1,"red",3);
ExpandedSubBlockEnd.gif    }

InBlock.gif
ExpandedSubBlockEnd.gif}

InBlock.gif    
ExpandedSubBlockEnd.gif}

InBlock.gifsetTimeout(
"GetData()",2000);
ExpandedSubBlockEnd.gif}

InBlock.gif
InBlock.gif
InBlock.gif
function setXOry(start)//调整画线坐标的函数
ExpandedSubBlockStart.gifContractedSubBlock.gif
dot.gif{
InBlock.gif
InBlock.gif    
if(start=="0")//向下
ExpandedSubBlockStart.gifContractedSubBlock.gif
    dot.gif{
InBlock.gif
InBlock.gif        x0
=x1
InBlock.gif        x1
=x1+3;
InBlock.gif        a
=1
InBlock.gif        y0
=y1
InBlock.gif
//    if(b==1)//代表a=2的时候是还是向下探地这时候,必须修正 y轴的起始点和终点一致保证 ----a=2时划的斜线于 a=0的时候划的横线联合起来形成无断点图
InBlock.gif
    ////{
InBlock.gif
    
InBlock.gif    
InBlock.gif    
//y0=y1
InBlock.gif
    //b=1
InBlock.gif

InBlock.gif    
//}//在这里b=1代表如果下一次直接绘制横县时也通知 a=0 修补y轴的起始点
ExpandedSubBlockEnd.gif
}

InBlock.gif
else if(start=="1")//下降
ExpandedSubBlockStart.gifContractedSubBlock.gif
dot.gif{
InBlock.gif    y0
=y1//平衡y轴
InBlock.gif
    x0=x1
InBlock.gif    x1
=x1+3//移动y轴的终点
InBlock.gif
    y1=y1+3
InBlock.gif    a
=1//如果a=1可以持续向下画 ,=0代表向平行画
InBlock.gif
    b=1
InBlock.gif
ExpandedSubBlockEnd.gif}

InBlock.gif
else if(start=="3")//上升
ExpandedSubBlockStart.gifContractedSubBlock.gif
dot.gif{
InBlock.gif    y0
=y1//平衡y轴
InBlock.gif
    x0=x1//平衡x轴
InBlock.gif
    x1=x1+3
InBlock.gif    y1
=y1-3
InBlock.gif    a
=0
InBlock.gif
ExpandedSubBlockEnd.gif}

ExpandedSubBlockEnd.gif}

InBlock.gif
InBlock.gif
InBlock.gif
InBlock.gif
InBlock.gif
InBlock.gif
function   drawLineAddString(x0,y0,x1,y1,color,size,ConText)//倒数第二个参数是竖线的大小,倒数第一个参数为显示的文字
ExpandedSubBlockStart.gifContractedSubBlock.gif
dot.gif{
InBlock.gif    rs   
=   "<table   style='top:"+y0+";left:"+x0+";position:absolute'>"+ConText+"<td   bgcolor="+color+"   height="+size+" width="+Math.abs(x1-x0)+"></td></table>";
InBlock.gif
return rs
ExpandedSubBlockEnd.gif}

InBlock.gif
InBlock.gif
InBlock.gif
InBlock.gif
function   drawLine(x0,y0,x1,y1,color,size)//倒数第一个参数是竖线的大小
ExpandedSubBlockStart.gifContractedSubBlock.gif
dot.gif{
InBlock.gif
InBlock.gif    
if   (y0   ==   y1)     //画横线
ExpandedSubBlockStart.gifContractedSubBlock.gif
    dot.gif{
InBlock.gif        rs   
=   "<table   style='top:"+y0+";left:"+x0+";position:absolute'><td   bgcolor="+color+"   height="+size+" width="+Math.abs(x1-x0)+"></td></table>";
ExpandedSubBlockEnd.gif    }

InBlock.gif    
else   if   (x0   ==   x1)     //画竖线    
ExpandedSubBlockStart.gifContractedSubBlock.gif
    dot.gif{    
InBlock.gif        rs   
=   "<table   style='top:"+y0+";left:"+x0+";position:absolute'><td   bgcolor="+color+"   width=1 height="+Math.abs(y1-y0)+"></td></table>";
ExpandedSubBlockEnd.gif    }

InBlock.gif    
else
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{
InBlock.gif    
var   lx   =   x1-x0
InBlock.gif    
var   ly   =   y1-y0
InBlock.gif    
var   l   =   Math.sqrt(lx*lx+ly*ly)//Math.sqrt求平方里面的参数x长度和y轴的上度
InBlock.gif
    rs   =   new   Array();
InBlock.gif    
for   (var   I=0;I<l;I+=1)//我猜这是划斜线的时候所以他一个格一个的画
ExpandedSubBlockStart.gifContractedSubBlock.gif
    dot.gif{//l是要画的格子的总数,
InBlock.gif
        var   p   =   I/l;
InBlock.gif        
var   px   =   x0   +   lx*p;//从新计算每一个格子的x轴的起点
InBlock.gif
        var   py   =   y0   +   ly*p;//y轴的起点
InBlock.gif
        rs[rs.length]   =   "<table   style='top:"+py+";left:"+px+";position:absolute'><td   bgcolor="+color+" height="+size+"></td></table>";
ExpandedSubBlockEnd.gif    }

InBlock.gif    rs   
=   rs.join("");
ExpandedSubBlockEnd.gif}

InBlock.gif
return   rs
ExpandedSubBlockEnd.gif}

InBlock.gif
InBlock.gif
InBlock.gif
ExpandedBlockEnd.gif
None.gif
</script>
None.gif    
</head>
None.gif    
<body text="#66ffff" bgColor="#808080" onload="GetData()">
None.gif        
<form name="111">
None.gif            
<div id="cs2"></div>
None.gif            
<div id="canvas"></div>
None.gif            
<div id="cs"></div>
None.gif        
</form>
None.gif    
</body>
None.gif
</HTML>
None.gif

下面是服务器代码


None.gif<%@ Page language="JScript" %>
None.gif
<%
None.gif
if(Application("Setup")==null)//设置状态专用的全局变量
ExpandedBlockStart.gifContractedBlock.gif
dot.gif{
InBlock.gif    Application(
"Setup")="pleaseWaitdot.gifdot.gif";//如果为刚刚启动
ExpandedBlockEnd.gif
}

None.gif
if(Application("Output")==null)
ExpandedBlockStart.gifContractedBlock.gif
dot.gif{
InBlock.gif    Application(
"Output")="pleaseWaitdot.gifdot.gif";
ExpandedBlockEnd.gif}

None.gifvar Input
=Request("t")
None.gif
None.gif
None.gifApplication(
"Setup")=Temp.join(",")//记住第
None.gif
//Session("Output")="0"//记住第一位置也就是数组下标0是状态
None.gif

None.gif
*/
None.gif
None.gif
if(Input=="Start")//启动状态
ExpandedBlockStart.gifContractedBlock.gif
dot.gif{
InBlock.gif    Response.Write(escape(Application(
"Setup")));
InBlock.gif
ExpandedBlockEnd.gif}

None.gif
else
ExpandedBlockStart.gifContractedBlock.gif
dot.gif{
InBlock.gif    Application(
"Setup")=Application("Setup")+Application("Output")//同时写设置状态是的新用户上来可以从当前时间继续往下看
InBlock.gif
    Response.Write(escape(Application("Output")));//发布时--Session("Output")
ExpandedBlockEnd.gif
}

None.gif
%>


这个是管理的后台页

ExpandedBlockStart.gifContractedBlock.gif<%dot.gif@ Page language="c#" Codebehind="ServerAdmin.aspx.cs" AutoEventWireup="false" Inherits="测试隐藏刷新.WebForm12" %>
None.gif
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
None.gif
<HTML>
None.gif    
<HEAD>
None.gif        
<title>WebForm12</title>
None.gif        
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
None.gif        
<meta name="CODE_LANGUAGE" Content="C#">
None.gif        
<meta name="vs_defaultClientScript" content="JavaScript">
None.gif        
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
None.gif        
<meta http-equiv="refresh" content="2">
None.gif    
</HEAD>
None.gif    
<body MS_POSITIONING="GridLayout" BGCOLOR="background" TEXT="#ffffff">
None.gif        
<form id="Form1" method="post" runat="server">
None.gif            
<FONT face="宋体">
None.gif                
<asp:Panel id="Panel1" style="Z-INDEX: 101; LEFT: 8px; POSITION: absolute; TOP: 8px" runat="server"
None.gif                    Width
="768px" Height="488px" HorizontalAlign="Center">
None.gif                    
<P>
None.gif                        
<asp:Button id="Button2" runat="server" Text="数据复位"></asp:Button></P>
None.gif                    
<P>&nbsp;</P>
None.gif                    
<P>&nbsp;</P>
None.gif                    
<P>&nbsp;</P>
None.gif                    
<P>
None.gif                        
<asp:Label id="Label1" runat="server" Height="48px" Width="336px" Font-Bold="True" Font-Size="XX-Large"
None.gif                            ForeColor
="ActiveCaptionText" EnableViewState="False">Label</asp:Label></P>
None.gif                    
<P>&nbsp;</P>
None.gif                    
<P>
None.gif                        
<asp:Label id="Label4" runat="server" Height="48" Width="210px" Font-Bold="True" Font-Size="XX-Large"
None.gif                            ForeColor
="Snow" EnableViewState="False"></asp:Label></P>
None.gif                    
<P>&nbsp;</P>
None.gif                    
<P>&nbsp;</P>
None.gif                
</asp:Panel>
None.gif                
<asp:Button id="Button1" style="Z-INDEX: 102; LEFT: 8px; POSITION: absolute; TOP: 8px" runat="server"
None.gif                    Text
="Button"></asp:Button></FONT>
None.gif        
</form>
None.gif    
</body>
None.gif
</HTML>
None.gif

服务器的后台代码

None.gifusing System;
None.gif
using System.Collections;
None.gif
using System.ComponentModel;
None.gif
using System.Data;
None.gif
using System.Drawing;
None.gif
using System.Web;
None.gif
using System.Web.SessionState;
None.gif
using System.Web.UI;
None.gif
using System.Web.UI.WebControls;
None.gif
using System.Web.UI.HtmlControls;
None.gif
using System.Data.SqlClient;
None.gif
using System.Configuration;
None.gif
namespace 测试隐藏刷新
ExpandedBlockStart.gifContractedBlock.gif
dot.gif{
ExpandedSubBlockStart.gifContractedSubBlock.gif    
/**//// <summary>
InBlock.gif    
/// WebForm12 的摘要说明。
ExpandedSubBlockEnd.gif    
/// </summary>

InBlock.gif    public class WebForm12 : System.Web.UI.Page
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{
InBlock.gif        
protected System.Web.UI.WebControls.Label Label4;
InBlock.gif        
protected System.Web.UI.WebControls.Panel Panel1;
InBlock.gif        
protected System.Web.UI.WebControls.Button Button1;
InBlock.gif        
protected System.Web.UI.WebControls.Button Button2;
InBlock.gif        
protected System.Web.UI.WebControls.Label Label1;
InBlock.gif        
InBlock.gif        
private void Page_Load(object sender, System.EventArgs e)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
InBlock.gif                
this.setSharelist();
InBlock.gif                Label1.Text
=System.DateTime.Now.ToLongTimeString();
InBlock.gif            
ExpandedSubBlockEnd.gif            }

InBlock.gif        
public void setSharelist()
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif
InBlock.gif            System.Data.SqlClient.SqlConnection SherCon 
= new SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"]);
InBlock.gif            
try
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                System.Data.SqlClient.SqlCommand SherCommand 
= new SqlCommand("New_shareList_Select",SherCon);
InBlock.gif                SherCommand.CommandType
=System.Data.CommandType.StoredProcedure;
InBlock.gif                SherCommand.Parameters.Add(
"@Count",System.Data.SqlDbType.Float);
InBlock.gif                SherCommand.Parameters[
"@Count"].Direction=ParameterDirection.Output;
InBlock.gif                SherCon.Open();
InBlock.gif                SherCommand.ExecuteNonQuery();
InBlock.gif                Label4.Text
=SherCommand.Parameters["@Count"].Value.ToString();
InBlock.gif                
this.setApplication(SherCommand.Parameters["@Count"].Value.ToString());
InBlock.gif
InBlock.gif
ExpandedSubBlockEnd.gif            }

InBlock.gif            
catch(Exception e)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                Response.Write(e);
InBlock.gif
ExpandedSubBlockEnd.gif            }

InBlock.gif            
finally
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                SherCon.Close();
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

InBlock.gif        
public void setApplication(String Count)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif                String Minute
=System.DateTime.Now.Minute.ToString();
InBlock.gif            String CheckDayUp
=System.DateTime.Now.Hour.ToString()+Minute;
InBlock.gif            Label1.Text
=CheckDayUp;
InBlock.gif            
if(Minute.Length<2)//如果小于10分钟那么前补零
ExpandedSubBlockStart.gifContractedSubBlock.gif
            dot.gif{
InBlock.gif                Minute
="0"+Minute;
InBlock.gif
ExpandedSubBlockEnd.gif            }

InBlock.gif            
//if(Convert.ToInt32(CheckDayUp)<1029 ||  Convert.ToInt32(CheckDayUp)>300)//如果小于10:29分那么就代表还么有开市
InBlock.gif            
//{//如果当前时间小于 10:29||并且大于3点代表处于修饰专状态
InBlock.gif                
//-----处于为开盘状态清楚数据
InBlock.gif
                if(Application["Setup"]==null)//设置状态专用的全局变量
ExpandedSubBlockStart.gifContractedSubBlock.gif
                dot.gif{
InBlock.gif                    
//第一位今天的初始点数,以后存初始化信息用,号分割
InBlock.gif
                    Application["Setup"]="pleaseWaitdot.gifdot.gif";//如果为刚刚启动
InBlock.gif
                        Application["Setup"]=Count+",";//如果为刚刚启动
ExpandedSubBlockEnd.gif
                }

InBlock.gif                
InBlock.gif
InBlock.gif                
if(Application["Output"]==null)//存储即使输出的信息
ExpandedSubBlockStart.gifContractedSubBlock.gif
                dot.gif{
InBlock.gif                    Application[
"Output"]="pleaseWaitdot.gifdot.gif";//0平,1降,3升
InBlock.gif

ExpandedSubBlockEnd.gif                }

InBlock.gif                
InBlock.gif            
InBlock.gif                
if(Session["DateTime"]==null)//存当前上政指数
ExpandedSubBlockStart.gifContractedSubBlock.gif
                dot.gif{
InBlock.gif                    Session[
"DateTime"]=Count;
InBlock.gif
ExpandedSubBlockEnd.gif                }

InBlock.gif                        Response.Write(
"关于股市开盘和修盘已经写到程序中但为了演示功能将判断部分注释了~<br>");
InBlock.gif        
//}
InBlock.gif            
//else
InBlock.gif 
InBlock.gif            
//{
InBlock.gif            
InBlock.gif    
//关于开市--必市已经作到程序里单未了掩饰所以去掉判断部分
InBlock.gif
                
InBlock.gif                
InBlock.gif                    
if(Session["DateTime"].ToString()=="")
ExpandedSubBlockStart.gifContractedSubBlock.gif                    
dot.gif{
InBlock.gif                        Session[
"DateTime"]=Count;
ExpandedSubBlockEnd.gif                    }

InBlock.gif                    
if(float.Parse(Session["DateTime"].ToString())<float.Parse(Count))//
ExpandedSubBlockStart.gifContractedSubBlock.gif
                    dot.gif{
InBlock.gif                        Application[
"Output"]="";
InBlock.gif                        
for(int i=0;i<10;i++)
ExpandedSubBlockStart.gifContractedSubBlock.gif                        
dot.gif{
InBlock.gif                            
if((float.Parse(Count)-(float.Parse(Session["DateTime"].ToString()))*i)>0)
ExpandedSubBlockStart.gifContractedSubBlock.gif                            
dot.gif{//控制输出多少个1叶就是下降多少位
InBlock.gif
                                Application["Output"]=Application["Output"].ToString()+"3,";
InBlock.gif                                Application[
"Setup"]=Application["Setup"].ToString()+"3,";
ExpandedSubBlockEnd.gif                            }

InBlock.gif
InBlock.gif
ExpandedSubBlockEnd.gif                        }

InBlock.gif
InBlock.gif
InBlock.gif
InBlock.gif
InBlock.gif
InBlock.gif
InBlock.gif
InBlock.gif
InBlock.gif                        Session[
"DateTime"]=Count;
InBlock.gif                    
//    Application["Output"]="3,";
InBlock.gif                    
//    Application["Setup"]=Application["Setup"].ToString()+"3,";
ExpandedSubBlockEnd.gif
                    }

InBlock.gif                
else if(float.Parse(Session["DateTime"].ToString())>float.Parse(Count))//
ExpandedSubBlockStart.gifContractedSubBlock.gif
                dot.gif{
InBlock.gif                        Application[
"Output"]="";
InBlock.gif                        
for(int i=0;i<10;i++)
ExpandedSubBlockStart.gifContractedSubBlock.gif                        
dot.gif{
InBlock.gif                            
if((float.Parse(Session["DateTime"].ToString())-(float.Parse(Count))*i)>0)
ExpandedSubBlockStart.gifContractedSubBlock.gif                            
dot.gif{//控制输出多少个1叶就是下降多少位
InBlock.gif
                                Application["Output"]=Application["Output"].ToString()+"1,";
InBlock.gif                                Application[
"Setup"]=Application["Setup"].ToString()+"1,";
ExpandedSubBlockEnd.gif                            }

InBlock.gif
InBlock.gif
ExpandedSubBlockEnd.gif                        }

InBlock.gif                Session[
"DateTime"]=Count;
InBlock.gif                
//Application["Output"]="1,";
InBlock.gif                
//Application["Setup"]=Application["Setup"].ToString()+"1,";
InBlock.gif

ExpandedSubBlockEnd.gif                }

InBlock.gif                
else //
ExpandedSubBlockStart.gifContractedSubBlock.gif
                dot.gif{
InBlock.gif                    Session[
"DateTime"]=Count;
InBlock.gif                    Application[
"Output"]="0,";
InBlock.gif                    Application[
"Setup"]=Application["Setup"].ToString()+"0,";
InBlock.gif
ExpandedSubBlockEnd.gif                }

InBlock.gif                
InBlock.gif                Response.Write(
"现在处于开市状态,今天开盘"+Application["Output"].ToString());
InBlock.gif            
InBlock.gif            
//}
InBlock.gif
            
InBlock.gif
InBlock.gif                    
InBlock.gif    
InBlock.gif
ExpandedSubBlockEnd.gif        }

ContractedSubBlock.gifExpandedSubBlockStart.gif        
Web 窗体设计器生成的代码#region Web 窗体设计器生成的代码
InBlock.gif        
override protected void OnInit(EventArgs e)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
//
InBlock.gif            
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
InBlock.gif            
//
InBlock.gif
            InitializeComponent();
InBlock.gif            
base.OnInit(e);
ExpandedSubBlockEnd.gif        }

InBlock.gif        
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//// <summary>
InBlock.gif        
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
InBlock.gif        
/// 此方法的内容。
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif        private void InitializeComponent()
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{    
InBlock.gif            
this.Button1.Click += new System.EventHandler(this.Button1_Click);
InBlock.gif            
this.Button2.Click += new System.EventHandler(this.Button2_Click);
InBlock.gif            
this.Load += new System.EventHandler(this.Page_Load);
InBlock.gif
ExpandedSubBlockEnd.gif        }

ExpandedSubBlockEnd.gif        
#endregion

InBlock.gif
InBlock.gif        
private void Button1_Click(object sender, System.EventArgs e)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            Application[
"Output"]="1,";
InBlock.gif            Application[
"Setup"]=Application["Setup"].ToString()+"1,";
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
private void Button2_Click(object sender, System.EventArgs e)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            Application[
"Output"]="0";
InBlock.gif            Application[
"Setup"]=Session["DateTime"].ToString()+",";
ExpandedSubBlockEnd.gif        }

ExpandedSubBlockEnd.gif    }

ExpandedBlockEnd.gif}

None.gif

转载于:https://www.cnblogs.com/ajaxren/archive/2007/05/15/746527.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值