netbox开启服务后自动访问首页

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
 Set ht = CreateObject("NetBox.HtmlWindow")
 ht.open "
http://localhost/index.html"
 ht.showDialog

End Sub
Sub OnServiceStop()
    httpd.Close
End Sub
Sub OnServicePause()
    httpd.Stop
End Sub
Sub OnServiceResume()
    httpd.Start
End Sub

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-02-07
  • 2022-12-23
  • 2021-04-16
  • 2022-12-23
  • 2021-11-29
猜你喜欢
  • 2022-02-06
  • 2021-09-11
  • 2021-11-09
  • 2021-09-02
  • 2022-01-14
  • 2021-07-20
  • 2021-10-20
相关资源
相似解决方案