public override void SetASPDotNetVersion(AspDotNetVersion version) { DirectoryEntry virDir = IISWMIHelper.GetIIsWebVirtualDir(SiteId); ScriptMapper.SetASPNetVersion(virDir, version); virDir.CommitChanges(); }
private void SetVirtualDirProperty(String propertyName, object propertyValue) { DirectoryEntry virDir = IISWMIHelper.GetIIsWebVirtualDir(SiteId); virDir.Properties[propertyName].Value = propertyValue; virDir.CommitChanges(); }
public static IISWMISite CreateNewSite(String serverComment, String serverBindings, String filePath) { Directory.CreateDirectory(filePath); IISWMISite retVal = new IISWMISite(); //Do not put any bindings in... we will do that after the site is create retVal.SiteId = Convert.ToString(IISWMIHelper.GetIIsWebService().Invoke("CreateNewSite", serverComment, new object[0], filePath)); retVal.SetBindings(serverBindings); return(retVal); }
public override void Start() { try { IISWMIHelper.GetIIsWebServer(SiteId).Invoke("Start", null); } catch (Exception exp) { throw new Exception(String.Format("Inner error: {0} Outer error: {1}", exp.InnerException.Message, exp.Message)); } }
public static bool DeleteSite(IISIdentifier siteIdentifier) { String id = ""; //need to be sure that the site exists or else it can throw an error if (IISWMIHelper.TryGetSiteID(siteIdentifier, ref id)) { DirectoryEntry webServer = IISWMIHelper.GetIIsWebServer(id); webServer.Invoke("Stop", null); webServer.DeleteTree(); return(true); } return(false); }
//Return null if the site is not to be found public static IISWMISite FindSite(IISIdentifier Identifier) { String id = ""; //need to be sure that the site exists or else it can throw an error if (IISWMIHelper.TryGetSiteID(Identifier, ref id)) { return(new IISWMISite() { SiteId = id }); } return(null); }
private T GetVirtualDirPropertyDef <T>(String propertyName, T DefaultValue) { PropertyValueCollection pc = IISWMIHelper.GetIIsWebVirtualDir(SiteId).Properties["propertyName"]; return((pc != null) ? (T)Convert.ChangeType(pc.Value, typeof(T)) : DefaultValue); }