木子屋 Dnawo's BLOG

NetBox创建一个简单的WEB服务器

👤 dnawo 📅 2006-06-27 👁 7145 👍 0 💬 0 🔄 本站原创
Dim httpd


Shell.Service.RunService "NBWeb", "NetBox Web Server", "NetBox Http Server Sample"

'---------------------- Service Event ---------------------

Sub OnServiceStart()
Set httpd = CreateObject("NetBox.HttpServer")

If httpd.Create("", 80) = 0 Then
Set host = httpd.AddHost("", "\wwwroot")

host.EnableScript = true
host.AddDefault "default.asp"
host.AddDefault "default.htm"

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

保存为box文件后运行即可

评论(0)

暂无评论。

计算题
评论需审核通过后显示
← 上一篇 WindowsXP蓝屏代码解释大全 下一篇 → Vb中shell的妙用