Weblogs Código

RecorteX

73 usuarios y 243 recortes de código
Usuario

Contraseña
Crear cuenta
asp csharp css fechas Flash html imagenes java javascript linux mysql oracle php sql SQLServer url vbnet web xhtml xml
Top Usuarios
fjmp76 (42)
albin (31)
josuebasurto (31)
juanjo (30)
pedrocaro (9)
stanz (8)
AndiXTRM (7)
Joserra (7)
miiglesi (6)
aplyca (5)
Top Etiquetas
php (38)
vbnet (28)
javascript (26)
html (25)
csharp (25)
java (24)
sql (18)
mysql (13)
xml (13)
css (10)
imagenes (7)
Flash (7)
xhtml (7)
linux (6)
asp (6)
fechas (6)
oracle (5)
url (5)
web (5)
SQLServer (5)

Crear subdominios con asp

Escribe aquí el texto

 
<%
 
' User Data
strUserID="bob"
strServer="server"
strRoot="c:\inetpub\wwwroot\"
strDomain=".somedomain.com"
 
' Create Users Folder
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.CreateFolder(strRoot&strUserID)
 
' Setup Connections To IIS
set locatorObj = CreateObject("WbemScripting.SWbemLocator") 
set providerObj = locatorObj.ConnectServer(strServer,"root/MicrosoftIISv2")
set serviceObj = providerObj.Get("IIsWebService='W3SVC'") 
 
' Set Site Data
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
 
'Create & Start Site
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
 
%>
 
Identifícate para dejar un comentario.
Proyecto: Juanjo Navarro, 2006 - Diseño: Albin