Microsoft.Web.Administration.ServerManager mgr = new Microsoft.Web.Administration.ServerManager(); Microsoft.Web.Administration.Site site = null; if (!DoesWebSiteExist(SITE)) { if (!System.IO.Directory.Exists(physicalPath)) { System.IO.Directory.CreateDirectory(physicalPath); } site = mgr.Sites.Add(SITE, physicalPath, System.Convert.ToInt32(ASPORT)); site.ApplicationDefaults.ApplicationPoolName = POOL; site.Bindings.Clear(); site.Bindings.Add(bindinfo, "http"); site.ServerAutoStart = true; mgr.CommitChanges(); } else { site = mgr.Sites[SITE]; site.ServerAutoStart = true; site.Bindings.Clear(); site.Bindings.Add(bindinfo, "http"); site.ServerAutoStart = true; mgr.CommitChanges(); }
site.Applications["/"].VirtualDirectories["/"].PhysicalPath = physicalPath;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)