====================================================================================
'Thank you for using the practical function program developed by ASP001 Studio
'HTTP://WWW.ASP001.NET
'==========================================================================='ASP001 Studio provides you with customized program development and enterprise Internet expansion services
'QQ: 1974229
'E-Mail: [email protected]
'For more programs download please go to HTTP://WWW.ASP001.NET
'====================================================================================
'Function introduction: Start/stop specifying WEB site using ASP
'This function uses ADSI and requires Administrators group user permissions
'Function name: AdminWebSite(Computer,WebSiteNum,DoWhat)
'Program Development: ASP001 Studio ChuQi
'Usage: AdminWebSite (computer name, site number, start/stop)
'Example: Start a site with site number 1 on the 127.0.0.1 computer
'AdminWebSite"127.0.0.1","1",1
'Example: Stop the site with site number 1 on the 127.0.0.1 computer
'AdminWebSite"127.0.0.1","1",0
'====================================================================================
FunctionAdminWebSite(Computer,WebSiteNum,DoWhat)
OnErrorResumeNext
SetobjServer=GetObject("IIS://"&Computer&"/W3SVC/"&WebSiteNum)
IfErr.Number<>0Then
Response.WriteNow&".Error code: "&Hex(Err)&"-"&"Cannot open the specified site<br>"
EndIf
ifDowhat=1then
'Use Start the site
objServer.Start
IfErr.Number<>0Then
Response.Write "Cannot start the specified web site<br>"
else
Response.Write "Specified Web Site has been started<br>"
EndIf
elseifDoWhat=0then
'Stop the site using Stop
objServer.Stop
IfErr.Number<>0Then
Response.Write "Cannot stop specifying web site<br>"
else
Response.Write "Specifying Web Site has stopped<br>"
EndIf
endif
EndFunction