Skip to content

Commit 857e4f7

Browse files
author
Guenter Knauf
committed
Added VBScript CGI sample for Windows.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1387439 13f79535-47bb-0310-9956-ffa450edef68
1 parent 00ff26e commit 857e4f7

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

docs/cgi-examples/printenv.vbs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
'!c:/windows/system32/cscript -nologo
2+
'#
3+
'# printenv -- demo CGI program which just prints its environment
4+
'#
5+
Option Explicit
6+
7+
Dim objShell, objArray, str, env
8+
Set objShell = CreateObject("WScript.Shell")
9+
Set objArray = CreateObject("System.Collections.ArrayList")
10+
11+
Wscript.Echo "Content-type: text/plain; charset=iso-8859-1" & vbLF
12+
For Each str In objShell.Environment("PROCESS")
13+
env = Split(str, "=", 2)
14+
env(1) = Replace(env(1), vbLF, "\n")
15+
objArray.Add env(0) & "=" & Chr(34) & env(1) & Chr(34)
16+
Next
17+
objArray.Sort()
18+
For Each str In objArray
19+
WScript.Echo str
20+
Next
21+
22+
'WScript.Echo ScriptEngine & " Version=" & ScriptEngineMajorVersion & "." & _
23+
' ScriptEngineMinorVersion & "." & ScriptEngineBuildVersion
24+

0 commit comments

Comments
 (0)