Dim httpd
Shell.Service.RunService "NBWeb","NetBox Web Server","NetBox Http Server Sample"
Sub OnServiceStart()
Set httpd=CreateObject("NetBox.HttpServer")
if httpd.Create("",80)=0 then
Set host=httpd.AddHost("","wwwroot")
host.EnableScript=True
host.AddDefault "default.html"
httpd.Start
else
Shell.Quit 0
end if
End Sub
Sub OnServiceStop()
httpd.Close
End Sub
Sub OnServicePause()
httpd.Stop
End Sub
Sub OnServiceResume()
httpd.Start
End Sub