xsljs000
你要的是这个文件吗?
main.box
Dim httpd
Shell.Service.RunService "通用远程管理服务器", "通用远程管理WEB服务器", "通用远程管理服务器"
Set NetBox("Shell") = Shell
'---------------------- Service Event ---------------------
Sub OnServiceStart()
Set httpd = CreateObject("NetBox.HttpServer")
If httpd.Create("",888) = 0 Then
Set host = httpd.AddHost("", "wwwroot")
host.EnableScript = true
host.AddDefault "default.asp"
host.AddDefault "index.asp"
host.AddDefault "index.htm"
host.sessionTimeout=120
host.EnableDebug=true
httpd.Start
'httpd.Timeout=60
'shell.MsgBox "远程访问服务已经启动", "系统提示", 64
Set htWin= CreateObject("NetBox.HtmlWindow")
htWin.Width = NetBox.SysInfo("Screen_Width")
htWin.height = NetBox.SysInfo("Screen_height")-40
htWin.left = 0
htWin.top = 0
htWin.Open "http://127.0.0.1:888/"
htWin.ShowDialog
else
shell.MsgBox "程序已经运行或默认端口被占用", "程序错误", 48
Set htWin= CreateObject("NetBox.HtmlWindow")
htWin.Width = NetBox.SysInfo("Screen_Width")
htWin.height = NetBox.SysInfo("Screen_height")-40
htWin.left = 0
htWin.top = 0
htWin.Open "http://127.0.0.1:888/"
htWin.ShowDialog
'Shell.Quit 0
end if
End Sub
Sub OnServiceStop()
httpd.Close
shell.MsgBox "远程访问服务已经关闭", "系统提示", 64
End Sub
Sub OnServicePause()
httpd.Stop
shell.MsgBox "远程访问服务已经暂停", "系统提示", 64
End Sub
Sub OnServiceResume()
httpd.Start
shell.MsgBox "远程访问服务已经启动", "系统提示", 64
End Sub |