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


C# IApplicationHost.GetSiteName方法代码示例

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


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

示例1:

 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

示例2: InvalidOperationException

 // if appHost is null, we use the site name for the current application
 string IServerConfig.MapPath(IApplicationHost appHost, VirtualPath path) {
     string siteName = (appHost == null) ? _siteNameForCurrentApplication : appHost.GetSiteName();
     string physicalPath = ProcessHostConfigUtils.MapPathActual(siteName, path);
     if (FileUtil.IsSuspiciousPhysicalPath(physicalPath)) {
         throw new InvalidOperationException(SR.GetString(SR.Cannot_map_path, path.VirtualPathString));
     }
     return physicalPath;
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:9,代码来源:ProcessHostServerConfig.cs

示例3: CreateObject

 public IRegisteredObject CreateObject(IApplicationHost appHost, Type type)
 {
     if (appHost == null)
         throw new ArgumentNullException("appHost");
     if (type == null)
         throw new ArgumentNullException("type");
     string appId = CreateSimpleAppId(VirtualPath.Create(appHost.GetVirtualPath()), appHost.GetPhysicalPath(), appHost.GetSiteName());
     return CreateObjectInternal(appId, type, appHost, false);
 }
开发者ID:DarkActive,项目名称:daFluorineFx,代码行数:9,代码来源:ApplicationManager.cs

示例4: CreateSimpleAppID

 private string CreateSimpleAppID(IApplicationHost appHost)
 {
     if (appHost == null)
     {
         throw new ArgumentNullException("appHost");
     }
     return this.CreateSimpleAppID(VirtualPath.Create(appHost.GetVirtualPath()), appHost.GetPhysicalPath(), appHost.GetSiteName());
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:ApplicationManager.cs

示例5:

        bool IServerConfig.GetUncUser(IApplicationHost appHost, VirtualPath path, out string username, out string password) {
            bool foundCreds = false;
            username = null;
            password = null;

            IntPtr pBstrUserName = IntPtr.Zero;
            int cBstrUserName = 0;
            IntPtr pBstrPassword = IntPtr.Zero;
            int cBstrPassword = 0;

            try {
                int result = UnsafeIISMethods.MgdGetVrPathCreds( IntPtr.Zero,
                                                                 appHost.GetSiteName(),
                                                                 path.VirtualPathString,
                                                                 out pBstrUserName,
                                                                 out cBstrUserName,
                                                                 out pBstrPassword,
                                                                 out cBstrPassword);
                if (result == 0) {
                    username = (cBstrUserName > 0) ? StringUtil.StringFromWCharPtr(pBstrUserName, cBstrUserName) : null;
                    password = (cBstrPassword > 0) ? StringUtil.StringFromWCharPtr(pBstrPassword, cBstrPassword) : null;
                    foundCreds = (!String.IsNullOrEmpty(username) && !String.IsNullOrEmpty(password));
                }
            }
            finally {
                if (pBstrUserName != IntPtr.Zero) {
                    Marshal.FreeBSTR(pBstrUserName);
                }
                if (pBstrPassword != IntPtr.Zero) {
                    Marshal.FreeBSTR(pBstrPassword);
                }
            }

            return foundCreds;
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:35,代码来源:ProcessHostServerConfig.cs

示例6: InvalidOperationException

 string IServerConfig.MapPath(IApplicationHost appHost, VirtualPath path)
 {
     string siteName = (appHost == null) ? this.CurrentAppSiteName : appHost.GetSiteName();
     string physicalPath = this._nativeConfig.MapPathDirect(siteName, path);
     if (FileUtil.IsSuspiciousPhysicalPath(physicalPath))
     {
         throw new InvalidOperationException(System.Web.SR.GetString("Cannot_map_path", new object[] { path.VirtualPathString }));
     }
     return physicalPath;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:10,代码来源:ExpressServerConfig.cs


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