当前位置:编程学习 > C#/ASP.NET >>

如何从global文件中获取数据(新手第一问请各位大大多关照)

    问题是这样的我在global.asax文件中生成一个随机的验证码定时刷新替换。
可我现在需要在别的地方获得这个这个验证码进行发送或对比验证应该怎么做??
这个是生成随机数的代码:
    void Application_Start(object sender, EventArgs e) 
    {
        // 在应用程序启动时运行的代码
        System.Timers.Timer aTimer = new System.Timers.Timer();
        aTimer.Elapsed += new System.Timers.ElapsedEventHandler(TimeEvent);
        //设置引发时间的时间间隔 此处设置为60秒(1000毫秒)
        aTimer.Interval = 1000;
        aTimer.Enabled = true;

    }
    
    private static void TimeEvent()
    {
        string RandKey;
        System.Random rand = new Random(System.DateTime.Now.Millisecond);
        RandKey = Convert.ToString(rand.Next(100000, 999999));
        return (RandKey);
    }

请各位大大支持下~!!
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,