Dim httpd
Shell.Service.RunService "NBWeb", "NetBox Web Server", "NetBox Http Server Sample"
'---------------------- Service Event ---------------------
Sub OnServiceStart()
Set httpd = NetBox.CreateObject("NetBox.HttpServer")
If httpd.Create("", 800) = 0 Then
Set host = httpd.AddHost("", "/wwwroot")
host.EnableScript = true
host.AddDefault "index.html"
httpd.Start
else
Shell.Quit 0
end if
// begin :加入的语句
Set ht = CreateObject("NetBox.HtmlWindow")
ht.open "http://localhost/index.html"
ht.showDialog
//end
End Sub
Sub OnServiceStop()
httpd.Close
End Sub
Sub OnServicePause()
httpd.Stop
End Sub
Sub OnServiceResume()
httpd.Start
End Sub