annoyances.org/ip to find your computer??™s
IP address). For example, if your IP address is 207.46.230.218, you??™d simply
type http://207.46.230.218/foldername/script.vbs. (If you have a router,
this won??™t work until you mess with your router??™s port range forwarding feature,
as described in ???Control Your PC Remotely??? in Chapter 7.)
Naturally, you??™ll probably want to generate dynamic (rather than static)
content with your CGI script. Here??™s a script that displays the current date
and time in the browser window:
WScript.Echo ""
WScript.Echo "Today's date is: " & Date
WScript.Echo "and the current time is: " & Time
WScript.Echo ""
For those familiar with writing CGI programs, you may be
concerned that there are no HTTP headers included here.
Although the CGI specification requires that a CGI program
produce its own HTTP headers (such as Content-type: text/
html), IIS automatically generates the headers based on the
type of content it thinks you??™re sending (text/html for
HTML or text/plain for plain text, for example). This not
only means that any headers you include (with WScript.Echo)
will simply appear as part of the generated page, but that you
can??™t add your own headers. Drat.
If you need to obtain the value of a browser environment variable in your
script, include this function:
Function Environment(EnviroName)
Set WshShell = Wscript.CreateObject("Wscript.Shell")
Set EnvHandle = WshShell.
Pages:
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751