当前位置: 首页>>代码示例>>C#>>正文


C# VirtualPath.MapPath方法代码示例

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


在下文中一共展示了VirtualPath.MapPath方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MapPath

 internal String MapPath(VirtualPath virtualPath) {
     if (_wr != null) {
         return MapPath(virtualPath, FilePathObject, true/*allowCrossAppMapping*/);
     }
     else {
         return virtualPath.MapPath();
     }
 }
开发者ID:uQr,项目名称:referencesource,代码行数:8,代码来源:HttpRequest.cs

示例2: HttpRequest

        internal HttpRequest(VirtualPath virtualPath, String queryString) {
            _wr = null;
            _pathTranslated = virtualPath.MapPath();
            _httpMethod = "GET";
            _url = new Uri("http://localhost" + virtualPath.VirtualPathString);
            _path = virtualPath;
            _queryStringText = queryString;
            _queryStringOverriden = true;
            _queryString = new HttpValueCollection(_queryStringText, true, true, Encoding.Default);

            PerfCounters.IncrementCounter(AppPerfCounter.REQUESTS_EXECUTING);
        }
开发者ID:uQr,项目名称:referencesource,代码行数:12,代码来源:HttpRequest.cs

示例3: IsUserAllowedToPath

 internal static bool IsUserAllowedToPath(HttpContext context, VirtualPath virtualPath)
 {
     return IsUserAllowedToFile(context, virtualPath.MapPath());
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:4,代码来源:FileAuthorizationModule.cs

示例4: MapPath

 internal string MapPath(VirtualPath virtualPath)
 {
     if (this._wr != null)
     {
         return this.MapPath(virtualPath, this.FilePathObject, true);
     }
     return virtualPath.MapPath();
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:HttpRequest.cs

示例5: StartListeningToLocalResourcesDirectory

 internal void StartListeningToLocalResourcesDirectory(VirtualPath virtualDir)
 {
     if (!this.IsFCNDisabled && ((this._callbackRenameOrCriticaldirChange != null) && (this._dirMonSpecialDirs != null)))
     {
         using (new ApplicationImpersonationContext())
         {
             this._lockDispose.AcquireReaderLock();
             try
             {
                 if (!this._disposed)
                 {
                     string path = FileUtil.RemoveTrailingDirectoryBackSlash(virtualDir.MapPath());
                     string fileName = Path.GetFileName(path);
                     path = Path.GetDirectoryName(path);
                     if (Directory.Exists(path))
                     {
                         this._dirMonSpecialDirs.Add(this.ListenToSubdirectoryChanges(path, fileName));
                     }
                 }
             }
             finally
             {
                 this._lockDispose.ReleaseReaderLock();
             }
         }
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:27,代码来源:FileChangesMonitor.cs

示例6: GetCodeDirectoryAssembly

 internal static Assembly GetCodeDirectoryAssembly(VirtualPath virtualDir, CodeDirectoryType dirType, string assemblyName, StringSet excludedSubdirectories, bool isDirectoryAllowed)
 {
     string path = virtualDir.MapPath();
     if (!isDirectoryAllowed && Directory.Exists(path))
     {
         throw new HttpException(System.Web.SR.GetString("Bar_dir_in_precompiled_app", new object[] { virtualDir }));
     }
     bool supportLocalization = IsResourceCodeDirectoryType(dirType);
     string cacheKey = assemblyName;
     BuildResult buildResultFromCache = BuildManager.GetBuildResultFromCache(cacheKey);
     Assembly a = null;
     if ((buildResultFromCache != null) && (buildResultFromCache is BuildResultCompiledAssembly))
     {
         if (buildResultFromCache is BuildResultMainCodeAssembly)
         {
             _mainCodeBuildResult = (BuildResultMainCodeAssembly) buildResultFromCache;
         }
         a = ((BuildResultCompiledAssembly) buildResultFromCache).ResultAssembly;
         if (!supportLocalization)
         {
             return a;
         }
         if (!isDirectoryAllowed)
         {
             return a;
         }
         BuildResultResourceAssembly assembly2 = (BuildResultResourceAssembly) buildResultFromCache;
         if (HashCodeCombiner.GetDirectoryHash(virtualDir) == assembly2.ResourcesDependenciesHash)
         {
             return a;
         }
     }
     if (!isDirectoryAllowed)
     {
         return null;
     }
     if ((dirType != CodeDirectoryType.LocalResources) && !StringUtil.StringStartsWithIgnoreCase(path, HttpRuntime.AppDomainAppPathInternal))
     {
         throw new HttpException(System.Web.SR.GetString("Virtual_codedir", new object[] { virtualDir.VirtualPathString }));
     }
     if (!Directory.Exists(path))
     {
         if (dirType != CodeDirectoryType.MainCode)
         {
             return null;
         }
         if (!ProfileBuildProvider.HasCompilableProfile)
         {
             return null;
         }
     }
     BuildManager.ReportDirectoryCompilationProgress(virtualDir);
     DateTime utcNow = DateTime.UtcNow;
     CodeDirectoryCompiler compiler = new CodeDirectoryCompiler(virtualDir, dirType, excludedSubdirectories);
     string outputAssemblyName = null;
     if (a != null)
     {
         outputAssemblyName = a.GetName().Name;
         compiler._onlyBuildLocalizedResources = true;
     }
     else
     {
         outputAssemblyName = BuildManager.GenerateRandomAssemblyName(assemblyName);
     }
     BuildProvidersCompiler compiler2 = new BuildProvidersCompiler(virtualDir, supportLocalization, outputAssemblyName);
     compiler._bpc = compiler2;
     compiler.FindBuildProviders();
     compiler2.SetBuildProviders(compiler._buildProviders);
     CompilerResults results = compiler2.PerformBuild();
     if (results != null)
     {
         DateTime time2 = DateTime.UtcNow.AddMilliseconds(3000.0);
         do
         {
             if (UnsafeNativeMethods.GetModuleHandle(results.PathToAssembly) == IntPtr.Zero)
             {
                 a = results.CompiledAssembly;
                 goto Label_01E6;
             }
             Thread.Sleep(250);
         }
         while (DateTime.UtcNow <= time2);
         throw new HttpException(System.Web.SR.GetString("Assembly_already_loaded", new object[] { results.PathToAssembly }));
     }
 Label_01E6:
     if (a == null)
     {
         return null;
     }
     if (dirType == CodeDirectoryType.MainCode)
     {
         _mainCodeBuildResult = new BuildResultMainCodeAssembly(a);
         buildResultFromCache = _mainCodeBuildResult;
     }
     else if (supportLocalization)
     {
         buildResultFromCache = new BuildResultResourceAssembly(a);
     }
     else
     {
//.........这里部分代码省略.........
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:101,代码来源:CodeDirectoryCompiler.cs


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