文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
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)
    {

    }

}

 

相关阅读 更多 +
排行榜 更多 +
亿连手机汽车互联车机版

亿连手机汽车互联车机版

生活实用 下载
植物大战僵尸返茂版内置作弊菜单下载

植物大战僵尸返茂版内置作弊菜单下载

策略塔防 下载
大连公交app下载官方版

大连公交app下载官方版

生活实用 下载