here is my code
i am trying to add a custom http header to the sub directory of my web site
is it possible to do this
ta
Gerard
Dim IISOBJ, CustomHeaders, Parts, HeaderName, HeaderValue
'Get the mimemap object.
Set IISOBJ = GetObject("IIS://LocalHost/W3SVC/1/root/test/css")
CustomHeaders = IISOBJ.HttpCustomHeaders
if (ubound(CustomHeaders) = -1) then
Redim CustomHeaders(0)
Index = 0
else
Redim Preserve CustomHeaders(UBOund(CustomHeaders)+1)
Index = UBOund(CustomHeaders)
end if
HeaderName = "Testing"
HeaderValue = "123456"
' Note: I beleive the space after the : is required!
CustomHeaders(Index) = headerName & ": " & HeaderValue
IISOBJ.HttpCustomHeaders = CustomHeaders
IISOBJ.SetInfo
WScript.Echo "Header Value"
WScript.Echo "=========================="
'Display the mappings
if (ubound(CustomHeaders) = -1) then
WScript.Echo "No custom headers defined for this web site"
else
for pos = lbound(CustomHeaders) to uBound(CustomHeaders)
Parts = Split(CustomHeaders(Pos), ":")
WScript.Echo Parts(0) & space(20-len(Parts(0))) & Parts(1)
next
end if