Dim httpd
Shell. Service. Icon = '\ 4088738 \ on.gif' ------ this is the icon you set yourself. You can follow this for friends who do not change the icon.
Shell. Service. runservice 'web', 'test', 'My space'
'---------------------- Service event start ---------------------
Sub onServicestart ()
Shell. Service. settimer 100
Set httpd = Createobject ('netbox. httpserver ')
If httpd. Create ('', 0) = 0 then
Set host = httpd. addhost ('','')
Host. enablewrite = false
Host. enablescript = true
Host. adddefault 'default. asp'
Host. adddefault 'default.htm'
Host. adddefault 'default.html'
Host. adddefault 'index. asp'
Host. adddefault 'index.htm'
Host. adddefault 'index.html'
Httpd. Start
Set htwin = Createobject ('netbox. htmlwindow ')
Htwin. Open 'HTTP: // 127.0.0.1/'------ the page is automatically opened by random ports.
Htwin. showdialog
Else
Shell. msgbox 'your port has been occupied, please close other programs before using ', 'xx homepage http://www.xxx.net/''' ------ this is the prompt when you encounter port occupation
Shell. Quit 0
End if
End sub
Sub onServicestop ()
Httpd. Close
End sub
Sub onServicepause ()
Shell. Service. Icon = '\ 4088738 \ off.gif'
Shell. msgbox 'server paused! Remember to open it when needed! ', 'Xx homepage http://www.xxx.net/''------ this is the prompt when your program is paused
Httpd. Stop
End sub
Sub onServiceresume ()
Httpd. Start
End sub
Sub onServicetimer
If shell. Service. Icon = '\ 4088738 \ on.gif' then
Shell. Service. Icon = '\ 4088738 \ on1.gif'
Else
Shell. Service. Icon = '\ 4088738 \ on.gif'
End if
End sub