當前位置: 首頁>>代碼示例>>C#>>正文


C# Web.VirtualPath類代碼示例

本文整理匯總了C#中System.Web.VirtualPath的典型用法代碼示例。如果您正苦於以下問題:C# VirtualPath類的具體用法?C# VirtualPath怎麽用?C# VirtualPath使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


VirtualPath類屬於System.Web命名空間,在下文中一共展示了VirtualPath類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: VirtualDirectoryMapping

 private VirtualDirectoryMapping(VirtualPath virtualDirectory, string physicalDirectory, bool isAppRoot, string configFileBaseName)
 {
     this._virtualDirectory = virtualDirectory;
     this._isAppRoot = isAppRoot;
     this.PhysicalDirectory = physicalDirectory;
     this.ConfigFileBaseName = configFileBaseName;
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:7,代碼來源:VirtualDirectoryMapping.cs

示例2: ParseFile

 private void ParseFile(string physicalPath, VirtualPath virtualPath)
 {
     string o = (physicalPath != null) ? physicalPath : virtualPath.VirtualPathString;
     if (this._circularReferenceChecker.Contains(o))
     {
         throw new HttpException(System.Web.SR.GetString("Circular_include"));
     }
     this._circularReferenceChecker.Add(o);
     try
     {
         TextReader reader;
         if (physicalPath != null)
         {
             using (reader = Util.ReaderFromFile(physicalPath, virtualPath))
             {
                 this.ParseReader(reader);
                 return;
             }
         }
         using (Stream stream = virtualPath.OpenFile())
         {
             reader = Util.ReaderFromStream(stream, virtualPath);
             this.ParseReader(reader);
         }
     }
     finally
     {
         this._circularReferenceChecker.Remove(o);
     }
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:30,代碼來源:DependencyParser.cs

示例3:

 bool IServerConfig.GetUncUser(IApplicationHost appHost, VirtualPath path, out string username, out string password)
 {
     bool flag = false;
     username = null;
     password = null;
     IntPtr zero = IntPtr.Zero;
     int cchUserName = 0;
     IntPtr bstrPassword = IntPtr.Zero;
     int cchPassword = 0;
     try
     {
         if (UnsafeIISMethods.MgdGetVrPathCreds(IntPtr.Zero, appHost.GetSiteName(), path.VirtualPathString, out zero, out cchUserName, out bstrPassword, out cchPassword) == 0)
         {
             username = (cchUserName > 0) ? StringUtil.StringFromWCharPtr(zero, cchUserName) : null;
             password = (cchPassword > 0) ? StringUtil.StringFromWCharPtr(bstrPassword, cchPassword) : null;
             flag = !string.IsNullOrEmpty(username) && !string.IsNullOrEmpty(password);
         }
     }
     finally
     {
         if (zero != IntPtr.Zero)
         {
             Marshal.FreeBSTR(zero);
         }
         if (bstrPassword != IntPtr.Zero)
         {
             Marshal.FreeBSTR(bstrPassword);
         }
     }
     return flag;
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:31,代碼來源:ProcessHostServerConfig.cs

示例4: GetAppPathForPathWorker

 private VirtualPath GetAppPathForPathWorker(string siteID, VirtualPath path)
 {
     string str;
     uint result = 0;
     if (!uint.TryParse(siteID, out result))
     {
         return VirtualPath.RootVirtualPath;
     }
     IntPtr zero = IntPtr.Zero;
     int cchPath = 0;
     try
     {
         str = ((UnsafeIISMethods.MgdGetAppPathForPath(IntPtr.Zero, result, path.VirtualPathString, out zero, out cchPath) == 0) && (cchPath > 0)) ? StringUtil.StringFromWCharPtr(zero, cchPath) : null;
     }
     finally
     {
         if (zero != IntPtr.Zero)
         {
             Marshal.FreeBSTR(zero);
         }
     }
     if (str == null)
     {
         return VirtualPath.RootVirtualPath;
     }
     return VirtualPath.Create(str);
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:27,代碼來源:ProcessHostMapPath.cs

示例5: ApplicationFileParser

		public ApplicationFileParser (string fname, HttpContext context)
		{
			InputFile = fname;
			Context = context;
			VirtualPath = new VirtualPath ("/" + Path.GetFileName (fname));
			LoadConfigDefaults ();
		}
開發者ID:tgiphil,項目名稱:mono,代碼行數:7,代碼來源:ApplicationFileParser.cs

示例6: GetConfig

        //
        // GetConfig(context, path) - returns the config at 'path'.
        //
        // This method is more efficient than not using context, as
        // the config cached in the context is used if it matches the
        // context path.
        //
        // For config derived from ConfigurationSection, this will either
        // return a non-null object or throw an exception.
        //
        // For config implemented with IConfigurationSectionHandler, this 
        // may return null, non-null, or throw an exception.
        //
        static internal RuntimeConfig GetConfig(HttpContext context, VirtualPath path) {
            if (!HttpConfigurationSystem.UseHttpConfigurationSystem)  {
                return GetClientRuntimeConfig();
            }

            return context.GetRuntimeConfig(path);
        }
開發者ID:JokerMisfits,項目名稱:linux-packaging-mono,代碼行數:20,代碼來源:RuntimeConfig.cs

示例7: CachedPathData

 internal CachedPathData(string configPath, VirtualPath virtualPath, string physicalPath, bool exists)
 {
     this._configPath = configPath;
     this._virtualPath = virtualPath;
     this._physicalPath = physicalPath;
     this._flags[4] = exists;
     string schemeDelimiter = Uri.SchemeDelimiter;
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:8,代碼來源:CachedPathData.cs

示例8: CodeBlockBuilder

 internal CodeBlockBuilder(CodeBlockType blockType, string content, int lineNumber, int column, VirtualPath virtualPath)
 {
     this._content = content;
     this._blockType = blockType;
     this._column = column;
     base.Line = lineNumber;
     base.VirtualPath = virtualPath;
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:8,代碼來源:CodeBlockBuilder.cs

示例9: AddSourceDependency

 internal void AddSourceDependency(VirtualPath fileName)
 {
     if (this._sourceDependencies == null)
     {
         this._sourceDependencies = new CaseInsensitiveStringSet();
     }
     this._sourceDependencies.Add(fileName.VirtualPathString);
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:8,代碼來源:SimpleWebHandlerParser.cs

示例10: MasterPageParser

		internal MasterPageParser (VirtualPath virtualPath, string inputFile, TextReader reader, HttpContext context)
			: base (virtualPath, inputFile, reader, context)
		{
			this.cacheEntryName = String.Concat ("@@MasterPagePHIDS:", virtualPath, ":", InputFile);
			
			contentPlaceHolderIds = HttpRuntime.InternalCache.Get (this.cacheEntryName) as List <string>;
			LoadConfigDefaults ();
		}
開發者ID:calumjiao,項目名稱:Mono-Class-Libraries,代碼行數:8,代碼來源:MasterPageParser.cs

示例11: AddDependency

 protected void AddDependency(VirtualPath virtualPath)
 {
     virtualPath = base.ResolveVirtualPath(virtualPath);
     if (this._virtualPathDependencies == null)
     {
         this._virtualPathDependencies = new CaseInsensitiveStringSet();
     }
     this._virtualPathDependencies.Add(virtualPath.VirtualPathString);
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:9,代碼來源:DependencyParser.cs

示例12: CombineVirtualPathsInternal

 internal static VirtualPath CombineVirtualPathsInternal(VirtualPath basePath, VirtualPath relativePath)
 {
     VirtualPathProvider virtualPathProvider = HostingEnvironment.VirtualPathProvider;
     if (virtualPathProvider != null)
     {
         return virtualPathProvider.CombineVirtualPaths(basePath, relativePath);
     }
     return basePath.Parent.Combine(relativePath);
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:9,代碼來源:VirtualPathProvider.cs

示例13: IsUserAllowedToPath

 internal static bool IsUserAllowedToPath(HttpContext context, VirtualPath virtualPath)
 {
     AuthorizationSection authorization = RuntimeConfig.GetConfig(context, virtualPath).Authorization;
     if (!authorization.EveryoneAllowed)
     {
         return authorization.IsUserAllowed(context.User, context.Request.RequestType);
     }
     return true;
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:9,代碼來源:UrlAuthorizationModule.cs

示例14: BuildManagerDirectoryBuilder

		public BuildManagerDirectoryBuilder (VirtualPath virtualPath)
		{
			if (virtualPath == null)
				throw new ArgumentNullException ("virtualPath");

			this.vpp = HostingEnvironment.VirtualPathProvider;
			this.virtualPath = virtualPath;
			this.virtualPathDirectory = VirtualPathUtility.GetDirectory (virtualPath.Absolute);
		}
開發者ID:tgiphil,項目名稱:mono,代碼行數:9,代碼來源:BuildManagerDirectoryBuilder.cs

示例15: AddVirtualPathToFileMapping

 internal static object AddVirtualPathToFileMapping(VirtualPath virtualPath, string physicalPath)
 {
     CallContext.SetData(GetFixedMappingSlotName(virtualPath), physicalPath);
     VirtualPathToFileMappingState state = new VirtualPathToFileMappingState {
         VirtualPath = virtualPath,
         VirtualPathProvider = _theHostingEnvironment._virtualPathProvider
     };
     _theHostingEnvironment._virtualPathProvider = _theHostingEnvironment._mapPathBasedVirtualPathProvider;
     return state;
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:10,代碼來源:HostingEnvironment.cs


注:本文中的System.Web.VirtualPath類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。