程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 更多編程語言 >> 編程問題解答 >> 如何偵測HTTP表頭信息?

如何偵測HTTP表頭信息?

編輯:編程問題解答

<html>

<head>

<title> 千花飛舞之HTTP headERS偵測< /title>

</head>

<body>

<TABLE BORDER=1>

<tr><td VALIGN=TOP><B>變量</B></td>

<td VALIGN=TOP><B>值</B></td></tr>

<% For Each key In Request.ServerVariables %>

<tr>

<td><% = key %></td>

<td>

<%

If Request.ServerVariables(key) = "" Then

If GetAttribute(key) = "" Then

Response.Write " "

Else

Response.Write GetAttribute(key)

End If

Else

Response.Write Request.ServerVariables(key)

End If

Response.Write "</td>"

%>

</tr>

<% Next %>

</TABLE>

</body></html>

 

<%

Function GetAttribute(AttrName)

Dim AllAttrs

Dim RealAttrName

Dim Location

Dim Result

AllAttrs = Request.ServerVariables("ALL_HTTP")

RealAttrName = AttrName

Location = instr(AllAttrs, RealAttrName & ":")

If Location <= 0 Then

GetAttribute = ""

Exit Function

End If

Result = mid(AllAttrs, Location + Len(RealAttrName) + 1)

Location = instr(Result, chr(10))

If Location <= 0 Then Location = len(Result) + 1

GetAttribute = left(Result, Location - 1)

End Function

 %>

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved