정보 보관 ver1.0
HttpRequest Class
James Wetzel
2009. 3. 17. 11:45
시나리오
웹 요청 도중 ASP.NET이 클라이언트에서 보낸 HTTP 값을 읽을 수 있도록 합니다.
네임스페이스: System.Web
어셈블리: System.Web(system.web.dll)
비고
HttpRequest.ServerVariables 속성
웹 서버 변수의 컬렉션을 가져옵니다.
int loop1, loop2;
NameValueCollection coll;
// Load ServerVariable collection into NameValueCollection object.
coll=Request.ServerVariables;
// Get names of all keys into a string array.
String[] arr1 = coll.AllKeys;
for (loop1 = 0; loop1 < arr1.Length; loop1++)
{
Response.Write("Key: " + arr1[loop1] + "<br>");
String[] arr2=coll.GetValues(arr1[loop1]);
for (loop2 = 0; loop2 < arr2.Length; loop2++) {
Response.Write("Value " + loop2 + ": " + Server.HtmlEncode(arr2[loop2]) + "<br>");
}
}
728x90
반응형