本文整理汇总了C#中WebsitePanel.Providers.Web.WebServer.CreateSite方法的典型用法代码示例。如果您正苦于以下问题:C# WebServer.CreateSite方法的具体用法?C# WebServer.CreateSite怎么用?C# WebServer.CreateSite使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WebsitePanel.Providers.Web.WebServer
的用法示例。
在下文中一共展示了WebServer.CreateSite方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddWebSite
//.........这里部分代码省略.........
site.PerlInstalled = Utils.ParseBool(webPolicy["PerlInstalled"], false);
site.PythonInstalled = Utils.ParseBool(webPolicy["PythonInstalled"], false);
site.CgiBinInstalled = Utils.ParseBool(webPolicy["CgiBinInstalled"], false);
site.ColdFusionInstalled = false;
}
else
{
// security settings
site.EnableWritePermissions = false;
site.EnableDirectoryBrowsing = false;
site.EnableParentPaths = false;
site.DedicatedApplicationPool = false;
site.EnableAnonymousAccess = true;
site.EnableWindowsAuthentication = true;
site.EnableBasicAuthentication = false;
// extensions
site.AspInstalled = true;
site.AspNetInstalled = "1";
site.PhpInstalled = "";
site.PerlInstalled = false;
site.PythonInstalled = false;
site.CgiBinInstalled = false;
site.ColdFusionInstalled = false;
}
site.HttpRedirect = "";
site.HttpErrors = null;
site.MimeMaps = null;
// CREATE WEB SITE
siteId = web.CreateSite(site);
// register item
site.ServiceId = serviceId;
site.PackageId = packageId;
site.Name = domainName;
site.SiteIPAddressId = addressId;
site.SiteId = siteId;
int siteItemId = PackageController.AddPackageItem(site);
// associate IP with web site
if (packageAddressId != 0)
ServerController.AddItemIPAddress(siteItemId, packageAddressId);
// update domain
// add main pointer
AddWebSitePointer(siteItemId, domain.DomainId, false);
// add instant pointer
if (addInstantAlias && !String.IsNullOrEmpty(instantAlias))
AddWebSitePointer(siteItemId, instantDomain.DomainId, false);
// add parking page
// load package
if (webPolicy["AddParkingPage"] != null)
{
bool addParkingPage = Utils.ParseBool(webPolicy["AddParkingPage"], false);
if (addParkingPage)
{
// add page
string pageName = webPolicy["ParkingPageName"];
string pageContent = webPolicy["ParkingPageContent"];