NETBOX启动文件

Dim httpd
'显示flash.exe
Shell.Execute "ui.exe","+16"
Shell.Service.RunService "AyangMovieSystem", "亚阳软件服务器端", "亚阳影视系统后台服务程序"
'---------------------- Service Event ---------------------
Shell.Service.Desktop = True
Shell.Service.TrayIcon = True
Sub OnServiceStart()
    Set httpd = NetBox.CreateObject("NetBox.HttpServer")
    If httpd.Create("",1982) = 0 Then
        Set host = httpd.AddHost("", "\admin")
        host.EnableScript = true
    host.AddDefault "index.asp"
        httpd.Start
        Shell.Service.Icon "ok.ico"
    else
        Shell.MsgBox "后台服务运行失败,可能服务己运行   ","亚阳软件",16
  Shell.Service.Icon "no.ico"
  Shell.Quit 0
    end if
 Shell.Service.AppendCommand "141","开启后台服务"
 Shell.Service.AppendCommand "128","停止后台服务"
 Shell.Service.AppendCommand "-1",""
 Shell.Service.AppendCommand "130","官方网站"
 Shell.Service.AppendCommand "140","关于软件"
 
End Sub
Sub OnServiceCommand(n)
 Select Case n
 Case 128
  httpd.Stop
     Shell.Service.Icon "no.ico"
  Shell.MsgBox "后台服务己停止,用户将无法访问系统后台   ","亚阳软件",64
 Case 129
   '//弹出注册
  Set ht = CreateObject("NetBox.HtmlWindow")
  ht.Icon = "ico16.ico"
  ht.MaximizeBox = false
  ht.MinimizeBox = false
  ht.scrollbar = false
  ht.width = 500
  ht.height = 320
        ht.open "http://127.0.0.1:1982/reg_soft.asp"
        ht.showDialog
  set ht=nothing
 Case 130
 '//弹出亚阳的官方网站
 Shell.Execute """C:\Program Files\Internet Explorer\IEXPLORE.EXE"" http://www.ayang.cn/"
 Case 140
  '//关于
  Set ht = CreateObject("NetBox.HtmlWindow")
  ht.Icon = "ico16.ico"
  ht.scrollbar = false
  ht.MaximizeBox = false
  ht.MinimizeBox = false
  ht.height = 410
  ht.width = 420
  ht.open "http://127.0.0.1:1982/about.asp"
        ht.showDialog
  set ht=nothing
 Case 141
  httpd.Start
  Shell.MsgBox "后台服务己启动   ","亚阳软件",64
        Shell.Service.Icon "ok.ico"
 Case Else
  Exit Sub
 End Select
End Sub
来自:http://blog.163.com/xinyingde/blog/static/17194744200962284218397/

你可能感兴趣的:(net)