httprequest.aspx.cs

来自「ASP.NET的一些开发实例,有论坛管理系统等」· CS 代码 · 共 70 行

CS
70
字号
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace aspnet.chapter06
{
	/// <summary>
	/// HttpRequest 的摘要说明。
	/// </summary>
	public class HttpRequest : System.Web.UI.Page
	{
		private void Page_Load(object sender, System.EventArgs e)
		{
			// 在此处放置用户代码以初始化页面
			if(!this.Page.IsPostBack)
			{
				HttpBrowserCapabilities bc = Request.Browser;
				Response.Write("<p>Browser Capabilities:</p>");
				Response.Write("Type = " + bc.Type + "<br>");
				Response.Write("Name = " + bc.Browser + "<br>");
				Response.Write("Version = " + bc.Version + "<br>");
				Response.Write("Major Version = " + bc.MajorVersion + "<br>");
				Response.Write("Minor Version = " + bc.MinorVersion + "<br>");
				Response.Write("Platform = " + bc.Platform + "<br>");
				Response.Write("Is Beta = " + bc.Beta + "<br>");
				Response.Write("Is Crawler = " + bc.Crawler + "<br>");
				Response.Write("Is AOL = " + bc.AOL + "<br>");
				Response.Write("Is Win16 = " + bc.Win16 + "<br>");
				Response.Write("Is Win32 = " + bc.Win32 + "<br>");
				Response.Write("Supports Frames = " + bc.Frames + "<br>");
				Response.Write("Supports Tables = " + bc.Tables + "<br>");
				Response.Write("Supports Cookies = " + bc.Cookies + "<br>");
				Response.Write("Supports VB Script = " + bc.VBScript + "<br>");
				Response.Write("Supports JavaScript = " + bc.JavaScript + "<br>");
				Response.Write("Supports Java Applets = " + bc.JavaApplets + "<br>");
				Response.Write("Supports ActiveX Controls = " + bc.ActiveXControls + "<br>");
				Response.Write("CDF = " + bc.CDF + "<br>");

			}
		}

		#region Web 窗体设计器生成的代码
		override protected void OnInit(EventArgs e)
		{
			//
			// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
			//
			InitializeComponent();
			base.OnInit(e);
		}
		
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{    
			this.Load += new System.EventHandler(this.Page_Load);
		}
		#endregion
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?