From 3ad727964ec7047aa7d8cdac9fe9f35bb375c6ff Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Wed, 19 Sep 2012 03:04:53 +0000 Subject: [PATCH] Added VBScript CGI sample for Windows. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1387439 13f79535-47bb-0310-9956-ffa450edef68 --- docs/cgi-examples/printenv.vbs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 docs/cgi-examples/printenv.vbs diff --git a/docs/cgi-examples/printenv.vbs b/docs/cgi-examples/printenv.vbs new file mode 100644 index 0000000000..b7e480d45e --- /dev/null +++ b/docs/cgi-examples/printenv.vbs @@ -0,0 +1,24 @@ +'!c:/windows/system32/cscript -nologo +'# +'# printenv -- demo CGI program which just prints its environment +'# +Option Explicit + +Dim objShell, objArray, str, env +Set objShell = CreateObject("WScript.Shell") +Set objArray = CreateObject("System.Collections.ArrayList") + +Wscript.Echo "Content-type: text/plain; charset=iso-8859-1" & vbLF +For Each str In objShell.Environment("PROCESS") + env = Split(str, "=", 2) + env(1) = Replace(env(1), vbLF, "\n") + objArray.Add env(0) & "=" & Chr(34) & env(1) & Chr(34) +Next +objArray.Sort() +For Each str In objArray + WScript.Echo str +Next + +'WScript.Echo ScriptEngine & " Version=" & ScriptEngineMajorVersion & "." & _ +' ScriptEngineMinorVersion & "." & ScriptEngineBuildVersion + -- 2.40.0