• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Web.HttpApplicationState类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Web.HttpApplicationState的典型用法代码示例。如果您正苦于以下问题:C# HttpApplicationState类的具体用法?C# HttpApplicationState怎么用?C# HttpApplicationState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



HttpApplicationState类属于System.Web命名空间,在下文中一共展示了HttpApplicationState类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: HttpApplicationStateWrapper

 public HttpApplicationStateWrapper(HttpApplicationState httpApplicationState)
 {
     if (httpApplicationState == null) {
         throw new ArgumentNullException("httpApplicationState");
     }
     _application = httpApplicationState;
 }
开发者ID:frenzypeng,项目名称:securityswitch,代码行数:7,代码来源:HttpApplicationStateWrapper.cs


示例2: Parent

 // 12/22/2007 Paul.  Inside the timer event, there is no current context, so we need to pass the application.
 public static DataTable Parent(HttpApplicationState Application, string sPARENT_TYPE, Guid gPARENT_ID)
 {
     DataTable dt = new DataTable();
     string sTABLE_NAME = Sql.ToString(Application["Modules." + sPARENT_TYPE + ".TableName"]);
     if ( !Sql.IsEmptyString(sTABLE_NAME) )
     {
         DbProviderFactory dbf = DbProviderFactories.GetFactory(Application);
         using ( IDbConnection con = dbf.CreateConnection() )
         {
             con.Open();
             string sSQL;
             sSQL = "select *"                + ControlChars.CrLf
                  + "  from vw" + sTABLE_NAME + ControlChars.CrLf
                  + " where ID = @ID"         + ControlChars.CrLf;
             using ( IDbCommand cmd = con.CreateCommand() )
             {
                 cmd.CommandText = sSQL;
                 Sql.AddParameter(cmd, "@ID", gPARENT_ID);
                 using ( DbDataAdapter da = dbf.CreateDataAdapter() )
                 {
                     ((IDbDataAdapter)da).SelectCommand = cmd;
                     da.Fill(dt);
                 }
             }
         }
     }
     return dt;
 }
开发者ID:NALSS,项目名称:splendidcrm-99885,代码行数:29,代码来源:Crm.cs


示例3: GetRoles

        public static List<Bubis.Andika.DAL.EF.Roles> GetRoles(HttpApplicationState application)
        {
            if (!RolesIsLoaded(application))
                LoadRoles(application);

            return application[ROLES_PAGES] as List<Bubis.Andika.DAL.EF.Roles>;
        }
开发者ID:BoccaDamian,项目名称:bubis,代码行数:7,代码来源:ApplicationHelper.cs


示例4: Broker

        public Broker(HttpApplicationState app)
        {
            this._app = app;
            LogUtil.Setup();
            StartSuperWebSocketByConfig();

        }
开发者ID:herohut,项目名称:elab,代码行数:7,代码来源:Server.Broker.cs


示例5: HttpApplicationStateWrapper

 public HttpApplicationStateWrapper(System.Web.HttpApplicationState httpApplicationState)
 {
     if (httpApplicationState == null)
     {
         throw new ArgumentNullException("httpApplicationState");
     }
     this._application = httpApplicationState;
 }
开发者ID:netcasewqs,项目名称:nlite.web,代码行数:8,代码来源:HttpApplicationStateWrapper.cs


示例6: OnStart

 public static void OnStart( HttpApplicationState appState )
 {
     // Uncomment to debug bootstrapping process.
     // Note: IIS 7 starts up far too fast for Visual Studio to attach.  If you need to
     //       Debug the bootstrapping process then you need to uncomment this line of code,
     //       connect to Rem through the browser.  This statement will force a debugger to
     //       attach to the worker process and enable you to debug.
     //System.Diagnostics.Debugger.Launch();
     new Bootstrapper().Run ( appState );
 }
开发者ID:divyang4481,项目名称:REM,代码行数:10,代码来源:Global.asax.cs


示例7: GetSessionId

 private string GetSessionId(HttpApplicationState Application)
 {
     if (Application["sessionId"] == null)
     {
         Application.Lock();
         Application["sessionId"] = opentok.CreateSession().Id;
         Application.UnLock();
     }
     return (string)Application["sessionId"];
 }
开发者ID:jeffswartz,项目名称:OpenTok-DotNet,代码行数:10,代码来源:HomeController.cs


示例8: initAssociationManager

 // todo: serialize access to this method
 private SingularAssociationManager initAssociationManager(HttpApplicationState application)
 {
     SingularAssociationManager returnValue = (SingularAssociationManager)application["dossia.openid.associationManager"];
     if (returnValue == null)
     {
         returnValue = new SingularAssociationManager();
         application["dossia.openid.associationManager"] = returnValue;
     }
     return returnValue;
 }
开发者ID:bewest,项目名称:dossia.org-examples,代码行数:11,代码来源:DossiaOpenID.cs


示例9: Term

		// 08/17/2005   Special Term function that helps with a list. 
		public static object Term(HttpApplicationState Application, string sCultureName, string sListName, object oField)
		{
			// 01/11/2008   Protect against uninitialized variables. 
			if ( String.IsNullOrEmpty(sListName) )
				return String.Empty;

			if ( oField == null || oField == DBNull.Value )
				return oField;
			// 11/28/2005   Convert field to string instead of cast.  Cast will not work for integer fields. 
			return Term(Application, sCultureName, sListName + oField.ToString());
		}
开发者ID:huamouse,项目名称:Taoqi,代码行数:12,代码来源:L10n.cs


示例10: BootcampCore

        public BootcampCore([NotNull] HttpServerUtility server, [NotNull] HttpApplicationState application, [CanBeNull] HttpResponse response, BootcampMode mode, bool noisy)
        {
            Assert.ArgumentNotNull(server, "server");
              Assert.ArgumentNotNull(application, "application");

              this.Server = server;
              this.Application = application;
              this.Response = response;
              this.Mode = mode;
              this.Noisy = noisy;
        }
开发者ID:Sitecore,项目名称:Sitecore-Bootcamp,代码行数:11,代码来源:BootcampCore.cs


示例11: Process

        public static void Process(HttpApplicationState Application)
        {
            if ( !bInsideWorkflow )
            {
                bInsideWorkflow = true;
                try
                {
                    //SplendidError.SystemMessage(Application, "Warning", new StackTrace(true).GetFrame(0), "WorkflowUtils.Process Begin");

                    spWORKFLOW_EVENTS_ProcessAll(Application);
                    /*
                    DbProviderFactory dbf = DbProviderFactories.GetFactory(Application);
                    using ( IDbConnection con = dbf.CreateConnection() )
                    {
                        string sSQL ;
                        sSQL = "select *                " + ControlChars.CrLf
                             + "  from vwWORKFLOW_EVENTS" + ControlChars.CrLf
                             + " order by AUDIT_VERSION " + ControlChars.CrLf;
                        using ( IDbCommand cmd = con.CreateCommand() )
                        {
                            cmd.CommandText = sSQL;
                            con.Open();

                            using ( DbDataAdapter da = dbf.CreateDataAdapter() )
                            {
                                ((IDbDataAdapter)da).SelectCommand = cmd;
                                using ( DataTable dt = new DataTable() )
                                {
                                    da.Fill(dt);
                                    if ( dt.Rows.Count > 0 )
                                        SplendidError.SystemMessage(Application, "Warning", new StackTrace(true).GetFrame(0), "Processing " + dt.Rows.Count.ToString() + " workflow events");
                                    foreach ( DataRow row in dt.Rows )
                                    {
                                        Guid gID = Sql.ToGuid(row["ID"]);
                                        // 12/30/2007 Paul.  We are not going to do anything yet, but we do need to clean up the table.
                                        spWORKFLOW_EVENTS_Delete(Application, gID);
                                    }
                                }
                            }
                        }
                    }
                    */
                }
                catch(Exception ex)
                {
                    SplendidError.SystemMessage(Application, "Error", new StackTrace(true).GetFrame(0), Utils.ExpandException(ex));
                }
                finally
                {
                    bInsideWorkflow = false;
                }
            }
        }
开发者ID:NALSS,项目名称:splendidcrm-99885,代码行数:53,代码来源:WorkflowUtils.cs


示例12: Culture

 // 12/22/2007 Paul.  Inside the timer event, there is no current context, so we need to pass the application.
 public static string Culture(HttpApplicationState Application)
 {
     string sCulture = Sql.ToString(Application["CONFIG.default_language"]);
     // 12/22/2007 Paul.  The cache is not available when we are inside the timer event.
     if ( HttpContext.Current != null && HttpContext.Current.Cache != null )
     {
         DataView vwLanguages = new DataView(SplendidCache.Languages());
         vwLanguages.RowFilter = "NAME = '" + sCulture +"'";
         if ( vwLanguages.Count > 0 )
             sCulture = Sql.ToString(vwLanguages[0]["NAME"]);
     }
     if ( Sql.IsEmptyString(sCulture) )
         sCulture = "en-US";
     return L10N.NormalizeCulture(sCulture);
 }
开发者ID:NALSS,项目名称:splendidcrm-99885,代码行数:16,代码来源:SplendidDefaults.cs


示例13: Culture

		// 12/22/2007   Inside the timer event, there is no current context, so we need to pass the application. 
		public static string Culture(HttpApplicationState Application)
		{
			string sCulture = Sql.ToString(Application["CONFIG.default_language"]);
			// 12/22/2007   The cache is not available when we are inside the timer event. 
			// 02/18/2008   The Languages function is now thread safe, so it can be called from the timer. 
			//if ( HttpContext.Current != null && HttpContext.Current.Cache != null )
			{
				DataView vwLanguages = new DataView(SplendidCache.Languages(Application));
				// 05/20/2008   Normalize culture before lookup. 
				vwLanguages.RowFilter = "NAME = '" + L10N.NormalizeCulture(sCulture) +"'";
				if ( vwLanguages.Count > 0 )
					sCulture = Sql.ToString(vwLanguages[0]["NAME"]);
			}
			if ( Sql.IsEmptyString(sCulture) )
				sCulture = "en-US";
			return L10N.NormalizeCulture(sCulture);
		}
开发者ID:huamouse,项目名称:Taoqi,代码行数:18,代码来源:SplendidDefaults.cs


示例14: CompileApplication

 private void CompileApplication()
 {
     this._theApplicationType = BuildManager.GetGlobalAsaxType();
     BuildResultCompiledGlobalAsaxType globalAsaxBuildResult = BuildManager.GetGlobalAsaxBuildResult();
     if (globalAsaxBuildResult != null)
     {
         if (globalAsaxBuildResult.HasAppOrSessionObjects)
         {
             this.GetAppStateByParsingGlobalAsax();
         }
         this._fileDependencies = globalAsaxBuildResult.VirtualPathDependencies;
     }
     if (this._state == null)
     {
         this._state = new HttpApplicationState();
     }
     this.ReflectOnApplicationType();
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:18,代码来源:HttpApplicationFactory.cs


示例15: CheckForUpdates

        internal static async void CheckForUpdates(HttpApplicationState application)
        {
            bool autoSuggestUpdate =
                Conversion.TryCastBoolean(ConfigurationHelper.GetUpdaterParameter("AutoSuggestUpdate"));

            if (autoSuggestUpdate)
            {
                try
                {
                    Updater.UpdateManager updater = new Updater.UpdateManager();
                    Release release = await updater.GetLatestReleaseAsync();

                    if (release != null)
                    {
                        application["UpdateAvailable"] = true;
                    }
                }
                catch (Exception ex)
                {
                    Log.Error("Exception occurred. {Exception}.", ex);
                }
            }
        }
开发者ID:njmube,项目名称:mixerp,代码行数:23,代码来源:UpdateManager.cs


示例16: InitInternal

        //
        //
        //

        internal void InitInternal(HttpContext context, HttpApplicationState state, MethodInfo[] handlers) {
            Debug.Assert(context != null, "context != null");

            // Remember state
            _state = state;

            PerfCounters.IncrementCounter(AppPerfCounter.PIPELINES);

            try {
                try {
                    // Remember context for config lookups
                    _initContext = context;
                    _initContext.ApplicationInstance = this;

                    // Set config path to be application path for the application initialization
                    context.ConfigurationPath = context.Request.ApplicationPathObject;

                    // keep HttpContext.Current working while running user code
                    using (new DisposableHttpContextWrapper(context)) {

                        // Build module list from config
                        if (HttpRuntime.UseIntegratedPipeline) {

                            Debug.Assert(_moduleConfigInfo != null, "_moduleConfigInfo != null");
                            Debug.Assert(_moduleConfigInfo.Count >= 0, "_moduleConfigInfo.Count >= 0");

                            try {
                                context.HideRequestResponse = true;
                                _hideRequestResponse = true;
                                InitIntegratedModules();
                            }
                            finally {
                                context.HideRequestResponse = false;
                                _hideRequestResponse = false;
                            }
                        }
                        else {
                            InitModules();

                            // this is used exclusively for integrated mode
                            Debug.Assert(null == _moduleContainers, "null == _moduleContainers");
                        }

                        // Hookup event handlers via reflection
                        if (handlers != null)
                            HookupEventHandlersForApplicationAndModules(handlers);

                        // Initialization of the derived class
                        _context = context;
                        if (HttpRuntime.UseIntegratedPipeline && _context != null) {
                            _context.HideRequestResponse = true;
                        }
                        _hideRequestResponse = true;

                        try {
                            Init();
                        }
                        catch (Exception e) {
                            RecordError(e);
                        }
                    }

                    if (HttpRuntime.UseIntegratedPipeline && _context != null) {
                        _context.HideRequestResponse = false;
                    }
                    _hideRequestResponse = false;
                    _context = null;
                    _resumeStepsWaitCallback= new WaitCallback(this.ResumeStepsWaitCallback);

                    // Construct the execution steps array
                    if (HttpRuntime.UseIntegratedPipeline) {
                        _stepManager = new PipelineStepManager(this);
                    }
                    else {
                        _stepManager = new ApplicationStepManager(this);
                    }

                    _stepManager.BuildSteps(_resumeStepsWaitCallback);
                }
                finally {
                    _initInternalCompleted = true;

                    // Reset config path
                    context.ConfigurationPath = null;

                    // don't hold on to the context
                    _initContext.ApplicationInstance = null;
                    _initContext = null;
                }
            }
            catch { // Protect against exception filters
                throw;
            }
        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:98,代码来源:HttpApplication.cs


示例17: spWORKFLOW_EVENTS_ProcessAll

 /// <summary>
 /// spWORKFLOW_EVENTS_ProcessAll
 /// </summary>
 public static void spWORKFLOW_EVENTS_ProcessAll(HttpApplicationState Application)
 {
     if ( HttpContext.Current != null && HttpContext.Current.Application != null )
     {
         // 12/22/2007 Paul.  By calling the SqlProcs version, we will ensure a compile-time error if the parameters change.
         SqlProcs.spWORKFLOW_EVENTS_ProcessAll();
     }
     else
     {
         DbProviderFactory dbf = DbProviderFactories.GetFactory(Application);
         using ( IDbConnection con = dbf.CreateConnection() )
         {
             con.Open();
             using ( IDbTransaction trn = con.BeginTransaction() )
             {
                 try
                 {
                     using ( IDbCommand cmd = con.CreateCommand() )
                     {
                         cmd.Transaction = trn;
                         cmd.CommandType = CommandType.StoredProcedure;
                         cmd.CommandText = "spWORKFLOW_EVENTS_ProcessAll";
                         cmd.ExecuteNonQuery();
                     }
                     trn.Commit();
                 }
                 catch(Exception ex)
                 {
                     trn.Rollback();
                     throw(new Exception(ex.Message, ex.InnerException));
                 }
             }
         }
     }
 }
开发者ID:NALSS,项目名称:splendidcrm-99885,代码行数:38,代码来源:WorkflowUtils.cs


示例18: DumpApplicationState

 /// <summary>
 /// Dumps the values found in the application state
 /// </summary>
 /// <param name="Input">Application state variable</param>
 /// <returns>A string containing the application state information</returns>
 public static string DumpApplicationState(HttpApplicationState Input)
 {
     StringBuilder String = new StringBuilder();
     foreach (string Key in Input.Keys)
     {
         String.Append(Key).Append(": ")
             .Append(Input[Key].ToString())
             .Append("<br />Properties<br />")
             .Append(Reflection.Reflection.DumpProperties(Input[Key]))
             .Append("<br />");
     }
     return String.ToString();
 }
开发者ID:pengyancai,项目名称:cs-util,代码行数:18,代码来源:HTML.cs


示例19: HttpApplicationStateAdapter

 public HttpApplicationStateAdapter(HttpApplicationState app)
 {
     this.app = app;
 }
开发者ID:ruanzx,项目名称:mausch,代码行数:4,代码来源:HttpApplicationStateAdapter.cs


示例20: InitSpecial

        internal void InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) {
            // Remember state
            _state = state;

            try {
                //  Remember the context for the initialization
                if (context != null) {
                    _initContext = context;
                    _initContext.ApplicationInstance = this;
                }

                // if we're doing integrated pipeline wireup, then appContext is non-null and we need to init modules and register event subscriptions with IIS
                if (appContext != IntPtr.Zero) {
                    // 1694356: app_offline.htm and <httpRuntime enabled=/> require that we make this check here for integrated mode
                    using (new ApplicationImpersonationContext()) {
                        HttpRuntime.CheckApplicationEnabled();
                    }

                    // retrieve app level culture
                    InitAppLevelCulture();

                    Debug.Trace("PipelineRuntime", "InitSpecial for " + appContext.ToString() + "\n");
                    RegisterEventSubscriptionsWithIIS(appContext, context, handlers);
                }
                else {
                    // retrieve app level culture
                    InitAppLevelCulture();

                    // Hookup event handlers via reflection
                    if (handlers != null) {
                        HookupEventHandlersForApplicationAndModules(handlers);
                    }
                }

                // if we're doing integrated pipeline wireup, then appContext is non-null and we need to register the application (global.asax) event handlers
                if (appContext != IntPtr.Zero) {
                    if (_appPostNotifications != 0 || _appRequestNotifications != 0) {
                        RegisterIntegratedEvent(appContext,
                                                HttpApplicationFactory.applicationFileName,
                                                _appRequestNotifications,
                                                _appPostNotifications,
                                                this.GetType().FullName,
                                                MANAGED_PRECONDITION,
                                                false);
                    }
                }
            }
            finally  {
                _initSpecialCompleted = true;

                //  Do not hold on to the context
                if (_initContext != null) {
                    _initContext.ApplicationInstance = null;
                    _initContext = null;
                }
            }
        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:57,代码来源:HttpApplication.cs



注:本文中的System.Web.HttpApplicationState类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Web.HttpBrowserCapabilities类代码示例发布时间:2022-05-26
下一篇:
C# Web.HttpApplication类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap