Programmatically use ASP to establish a Web site in IIS

xiaoxiao2021-03-06  47

'' ********************************************************* ******* '' Create a webserver '' must parameter: Wroot, for the physical directory of the site; WComment is a site description; WPORT is the site port; ServerRun is automatically run "Returns 1 when the creation is successful, When you fail, you prompt and return 0. When you create a site success but return 2 '' ***************************************************** ************************ '*************** Note: WPORT is the list type, Means the server port ************* 'This function is passed on IIS5.0, ** must log in to the administrator **' port example: '' DIM WPORT, BINDLISTS, CreateFlag, Ocomputer '' OComputer = "localhost" '' binglists = array (0) '' binglists (0) = ": 80:" 'port number 80' 'wport = binglists'' createflag = CreateWebServer ("D: / myWeb, "My Home", WPORT, FALSE) '' Calling Station Function '' 'IF Creatflag = 0 THEN' '' RESPONSE.WRITE "Created Site Failed! Please determine if there is permission" 'Elseif CreateFlag = 1 Then' 'Response.write "Create Site Success!"' 'Elseif Createflag = 2 TEN' 'RESPONSE.WRITE "Create a site success, but the startup site failed, possible port conflicts!"' End if '' ******* *********************************************************** *********************** "about the creation of the FTP site I have published in the ASP version, please visit Function CreateWeb Server yourself (WROOT, WComment, WPORT, Serverrun on Error Resme next Dim ServiceObj, Serverobj, Vdirobj Set serviceObj = getObject ("IIS: //") '' Create a service instance Wnumber = 1 do while isobject (ServiceObj.getObject ("IisWebserver", Wnumber) if Err.Number <> 0 THEN Err.clear () exit do end if wnumber = WNUMBER 1 LOOP SET ServerObj =

转载请注明原文地址:https://www.9cbs.com/read-111987.html

New Post(0)