NetBox 2.7 使用手册

开启 WEB 服务器脚本程序的错误调试

NetBoxHttpServer 对象支持对于服务器脚本程序的全局设定,通过设定 EnableDebug,可以一次打开或禁止所有服务器脚本程序的运行时间错误捕捉

下面的代码打开 HttpServer 的服务器脚本程序的错误调试:

Set Console = Shell.Console
Set httpd = CreateObject("NetBox.HttpServer")

If httpd.Create("", 80) = 0 Then
    Set host = httpd.AddHost("", "\wwwroot")
    host.AddDefault "default.htm"
    host.EnableDebug = true

    httpd.Start

    Console.ReadLine

    httpd.Stop
    httpd.Close
End If

Set httpd = Nothing

通过使用 EnableDebug,可以设置此主机所执行的所有脚本程序的错误调试模式,然而如果服务器脚本程序中自行设定了调试模式,则程序最终以自行制定的模式运行。


版权所有: 2003- 网络盒子