文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>WebSite建立能访问的Global

WebSite建立能访问的Global

时间:2010-08-31  来源:RedQ-Alright

由于WebSite建立的Global文件默认是内建式的,不在appcode里,所以无法访问,这时就需要我们手动修改.

<%@ Application Codebehind="App_Code\Global.cs" Inherits="Global" Language="C#" %>

然后在app_code中加入 Global类

using System;
using System.Collections.Generic;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;
using System.Timers;
public class Global : System.Web.HttpApplication
{
    public static Timer aTimer = new Timer();

    protected void Application_Start(object sender, EventArgs e)
    {
        Global.aTimer.Elapsed += new ElapsedEventHandler(aTimer_Elapsed);
    }

    void aTimer_Elapsed(object sender, ElapsedEventArgs e)
    {
        System.Data.DataTable ds = MySqlDB.GetChangesOnLdapServer();
        if (ds.Rows.Count > 0)
        {
            MySqlDB.AddNewUser(ds);
        }
    }
    protected void Session_Start(object sender, EventArgs e)
    {

    }

    protected void Application_BeginRequest(object sender, EventArgs e)
    {

    }

    protected void Application_AuthenticateRequest(object sender, EventArgs e)
    {

    }

    protected void Application_Error(object sender, EventArgs e)
    {

    }

    protected void Session_End(object sender, EventArgs e)
    {

    }

    protected void Application_End(object sender, EventArgs e)
    {

    }

}

 

相关阅读 更多 +
排行榜 更多 +
盒子小镇2游戏手机版下载

盒子小镇2游戏手机版下载

冒险解谜 下载
世界盒子模组版下载最新版本

世界盒子模组版下载最新版本

模拟经营 下载
音乐搜索app最新版本下载

音乐搜索app最新版本下载

趣味娱乐 下载