本文整理汇总了C#中System.Web.VirtualPath类的典型用法代码示例。如果您正苦于以下问题:C# VirtualPath类的具体用法?C# VirtualPath怎么用?C# VirtualPath使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VirtualPath类属于System.Web命名空间,在下文中一共展示了VirtualPath类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: ComputeSourceDependenciesHashCode
internal override string ComputeSourceDependenciesHashCode(VirtualPath virtualPath)
{
if (virtualPath == null)
{
virtualPath = base.VirtualPath;
}
HashCodeCombiner combiner = new HashCodeCombiner();
combiner.AddResourcesDirectory(virtualPath.MapPathInternal());
return combiner.CombinedHashString;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:10,代码来源:BuildResultResourceAssembly.cs
示例17: UserControlParser
internal UserControlParser (VirtualPath virtualPath, string inputFile, HttpContext context, string type)
{
VirtualPath = virtualPath;
Context = context;
BaseVirtualDir = virtualPath.DirectoryNoNormalize;
InputFile = inputFile;
SetBaseType (type);
AddApplicationAssembly ();
LoadConfigDefaults ();
}
开发者ID:nlhepler,项目名称:mono,代码行数:10,代码来源:UserControlParser.cs
示例18: GetReferencedType
internal Type GetReferencedType(VirtualPath virtualPath, bool allowNoCompile)
{
virtualPath = base.ResolveVirtualPath(virtualPath);
if ((base._pageParserFilter != null) && !base._pageParserFilter.AllowVirtualReference(base.CompConfig, virtualPath))
{
base.ProcessError(System.Web.SR.GetString("Reference_not_allowed", new object[] { virtualPath }));
}
BuildResult vPathBuildResult = null;
Type baseType = null;
try
{
vPathBuildResult = BuildManager.GetVPathBuildResult(virtualPath);
}
catch (HttpCompileException exception)
{
if (exception.VirtualPathDependencies != null)
{
foreach (string str in exception.VirtualPathDependencies)
{
base.AddSourceDependency(VirtualPath.Create(str));
}
}
throw;
}
catch
{
if (this.IgnoreParseErrors)
{
base.AddSourceDependency(virtualPath);
}
throw;
}
BuildResultNoCompileTemplateControl control = vPathBuildResult as BuildResultNoCompileTemplateControl;
if (control != null)
{
if (!allowNoCompile)
{
return null;
}
baseType = control.BaseType;
}
else
{
if (!(vPathBuildResult is BuildResultCompiledType))
{
throw new HttpException(System.Web.SR.GetString("Invalid_typeless_reference", new object[] { "src" }));
}
BuildResultCompiledType type2 = (BuildResultCompiledType) vPathBuildResult;
baseType = type2.ResultType;
}
base.AddTypeDependency(baseType);
base.AddBuildResultDependency(vPathBuildResult);
return baseType;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:54,代码来源:BaseTemplateParser.cs
示例19: GetPathConfigFilenameWorker
private void GetPathConfigFilenameWorker(string siteID, VirtualPath path, out string directory, out string baseName)
{
directory = this.MapPathCaching(siteID, path);
if (directory != null)
{
baseName = "web.config";
}
else
{
baseName = null;
}
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:12,代码来源:ProcessHostMapPath.cs
示例20: FindMapping
internal HttpHandlerAction FindMapping(string verb, VirtualPath path)
{
this.ValidateHandlers();
for (int i = 0; i < this.Handlers.Count; i++)
{
HttpHandlerAction action = this.Handlers[i];
if (action.IsMatch(verb, path))
{
return action;
}
}
return null;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:13,代码来源:HttpHandlersSection.cs
注:本文中的System.Web.VirtualPath类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论