本文整理汇总了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;
}
示例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);
}
}
示例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;
}
示例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);
}
示例5: ApplicationFileParser
public ApplicationFileParser (string fname, HttpContext context)
{
InputFile = fname;
Context = context;
VirtualPath = new VirtualPath ("/" + Path.GetFileName (fname));
LoadConfigDefaults ();
}
示例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);
}
示例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;
}
示例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;
}
示例9: AddSourceDependency
internal void AddSourceDependency(VirtualPath fileName)
{
if (this._sourceDependencies == null)
{
this._sourceDependencies = new CaseInsensitiveStringSet();
}
this._sourceDependencies.Add(fileName.VirtualPathString);
}
示例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 ();
}
示例11: AddDependency
protected void AddDependency(VirtualPath virtualPath)
{
virtualPath = base.ResolveVirtualPath(virtualPath);
if (this._virtualPathDependencies == null)
{
this._virtualPathDependencies = new CaseInsensitiveStringSet();
}
this._virtualPathDependencies.Add(virtualPath.VirtualPathString);
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}