Milad Azimi

Milad Azimi

  • NA
  • 6
  • 2.5k

Subdomain

Feb 4 2006 4:11 AM
Hi all How can i create a Subdomian in ASP.Net v.2 using .Net managed codes. i could do it in this way.. ========================================================= strUserID="Milad" strServer="server" strRoot="c:\inetpub\wwwroot\" strDomain=".myweb.com" Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.CreateFolder(strRoot&strUserID) set locatorObj = CreateObject("WbemScripting.SWbemLocator") set providerObj = locatorObj.ConnectServer(strServer,"root/MicrosoftIISv2") set serviceObj = providerObj.Get("IIsWebService='W3SVC'") Bindings = Array(0,0) Set Bindings(0) = providerObj.get("ServerBinding").SpawnInstance_() Bindings(0).IP = "" Bindings(0).Port = "80" Bindings(0).Hostname = strUserID&strDomain Set Bindings(1) = providerObj.get("ServerBinding").SpawnInstance_() Bindings(1).IP = "" Bindings(1).Port = "80" Bindings(1).Hostname = "www."&strUserID&strDomain strSiteObjPath = serviceObj.CreateNewSite(strUserID, Bindings, strRoot&strUserID) Set objPath = CreateObject("WbemScripting.SWbemObjectPath") objPath.Path = strSiteObjPath strSitePath = objPath.Keys.Item("") Set serverObj = providerObj.Get(strSiteObjPath) serverObj.Start ========================================================= But is it possible to do it using dotnet managed codes. thanks.