static void Main(string[] args) { var Name = "TestSite Attempt1"; var Proto = "http"; var Binding = "*:80:TestUrl.co.za"; var BindingAddProto = "HTTPS"; var BindingToAdd = "Test.co.za"; var Path = @"DirToSite"; var RemoveSite = true; CoreIISFeatures cis = new CoreIISFeatures(); //var sites = cis.GetIISSite(); //foreach(Site site in sites) //{ // Console.WriteLine("Site Id : "+site.Id + " Site Name : " + site.Name); //} CoreIISFeatures.RemoveIISWebsite(Name, RemoveSite); var CreateSite = CoreIISFeatures.CreateSite(Name, Proto, Binding, Path); Console.WriteLine(CreateSite); var Bindings = CoreIISFeatures.AddBindings(Name, BindingToAdd, BindingAddProto); Console.WriteLine(Bindings); }
public JsonResult CreateSite(IISSiteModel iISSite) { var CreateSite = CoreIISFeatures.CreateSite(iISSite.SiteName, iISSite.Proto, iISSite.Bindings, iISSite.PathToSite); return(Json(CreateSite)); }