Пример #1
0
 public void SetupIIS()
 {
     if (iisManager.SiteExists(testSiteName))
     {
         iisManager.DeleteSite(testSiteName);
     }
     iisManager.CreateSite(testSiteName, testSiteDomain, PrimaryIISRoot, "DefaultAppPool");
     Assert.IsTrue(iisManager.SiteExists(testSiteName));
 }
Пример #2
0
 /// <summary>
 /// 尝试创建升级中转站
 /// </summary>
 public void TryCreateUpgradeTransferSite(Site siteInfo)
 {
     try
     {
         if (siteInfo == null)
         {
             throw new ArgumentNullException("siteinfo is null");
         }
         var rootPath = AppDomain.CurrentDomain.BaseDirectory;
         siteInfo.PhysicalPath = $"{rootPath}" + siteInfo.PhysicalPath;
         IISManager.CreateSite(siteInfo);
         Clients.All.tranfersitecallback(new { success = true, msg = "站点创建成功", url = siteInfo.DefaultPage });
     }
     catch (Exception ex)
     {
         Logger.Error(ex.Message, ex);
         Clients.All.tranfersitecallback(new { success = false, msg = ex.Message });
     }
 }