asp.net 判断集成和经典模式

protected void Application_Start(object sender, EventArgs e)
        {
            log4net.Config.XmlConfigurator.Configure();

            try
            {
                var path = HttpContext.Current.Request.ApplicationPath;
                log.Info("网站以经典模式启动。");
                throw new Exception("网站必须以集成模式运行!");
            }
            catch (HttpException ex)
            {
                log.Info("网站以集成模式启动。");
            }
            catch
            {
                throw;
            }
        }

 

posted on 2022-10-27 20:54  空明流光  阅读(27)  评论(0编辑  收藏  举报

导航