]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Added VBScript CGI sample for Windows.
authorGuenter Knauf <fuankg@apache.org>
Wed, 19 Sep 2012 03:04:53 +0000 (03:04 +0000)
committerGuenter Knauf <fuankg@apache.org>
Wed, 19 Sep 2012 03:04:53 +0000 (03:04 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1387439 13f79535-47bb-0310-9956-ffa450edef68

docs/cgi-examples/printenv.vbs [new file with mode: 0644]

diff --git a/docs/cgi-examples/printenv.vbs b/docs/cgi-examples/printenv.vbs
new file mode 100644 (file)
index 0000000..b7e480d
--- /dev/null
@@ -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
+