<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body>
<p><%
for each item in Request.ServerVariables
response.write(item & " = " & Request.ServerVariables(item) & "<br>")
next
%></p>
</body>
</html>
這是C#的版本
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.WebForm1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body>
<p><%
foreach (string item in Request.ServerVariables)
{
Response.Write(item + " = " + Request.ServerVariables[item].ToString()+"<br>");
}
%></p>
</body>
</html>
執行結果
沒有留言:
張貼留言