本文整理汇总了C#中SPWebApplication.ProvisionGlobally方法的典型用法代码示例。如果您正苦于以下问题:C# SPWebApplication.ProvisionGlobally方法的具体用法?C# SPWebApplication.ProvisionGlobally怎么用?C# SPWebApplication.ProvisionGlobally使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SPWebApplication
的用法示例。
在下文中一共展示了SPWebApplication.ProvisionGlobally方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExtendWebApp
/// <summary>
/// Extends the web app.
/// </summary>
/// <param name="webApplication">The web application.</param>
/// <param name="description">The description.</param>
/// <param name="hostHeader">The host header.</param>
/// <param name="port">The port.</param>
/// <param name="loadBalancedUrl">The load balanced URL.</param>
/// <param name="path">The path.</param>
/// <param name="allowAnonymous">if set to <c>true</c> [allow anonymous].</param>
/// <param name="useNtlm">if set to <c>true</c> [use NTLM].</param>
/// <param name="useSsl">if set to <c>true</c> [use SSL].</param>
/// <param name="zone">The zone.</param>
public static void ExtendWebApp(SPWebApplication webApplication, string description, string hostHeader, int port, string loadBalancedUrl, string path, bool allowAnonymous, bool useNtlm, bool useSsl, SPUrlZone zone)
{
SPServerBinding serverBinding = null;
SPSecureBinding secureBinding = null;
if (!useSsl)
{
serverBinding = new SPServerBinding();
serverBinding.Port = port;
serverBinding.HostHeader = hostHeader;
}
else
{
secureBinding = new SPSecureBinding();
secureBinding.Port = port;
}
SPIisSettings settings = new SPIisSettings(description, allowAnonymous, useNtlm, serverBinding, secureBinding, new DirectoryInfo(path.Trim()));
settings.PreferredInstanceId = GetPreferredInstanceId(description);
webApplication.IisSettings.Add(zone, settings);
webApplication.AlternateUrls.SetResponseUrl(new SPAlternateUrl(new Uri(loadBalancedUrl), zone));
webApplication.AlternateUrls.Update();
webApplication.Update();
webApplication.ProvisionGlobally();
}