csprofileprovider.cs

来自「本系统是在asp版《在线文件管理器》的基础上设计制作」· CS 代码 · 共 48 行

CS
48
字号
//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
//     Copyright (c) Telligent Systems Corporation.  All rights reserved.
// </copyright> 
//------------------------------------------------------------------------------

using System;
using Microsoft.ScalableHosting.Profile;

namespace CommunityServer.Components
{
    /// <summary>
    /// CSProfileProvider overrides SqlProfileProvider ApplicationName value 
    /// to enable multiple sites to use the same appName/AppDomain. If a valid site
    /// is found, the appName specified in the web.config section will be overriden.
    /// </summary>
	public class CSProfileProvider : SqlProfileProvider
	{
		public CSProfileProvider()
		{
			//
			// TODO: Add constructor logic here
			//
		}

        /// <summary>
        /// Overrides the ApplicationName value which is set via an HttpModule.
        /// If this value is not set, the default value from the web.config is
        /// used instead.
        /// </summary>
        public override string ApplicationName
        {
            get
            {                
                string name = CSContext.Current.SiteSettings.ApplicationName;
                if(name == null)
                    name = base.ApplicationName;
                                
                return name;
            }
            set
            {
                base.ApplicationName = value;
            }
        }
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?