Use of the request object

Source: Internet
Author: User

From: http://www.51fy.cn/web/ASPNET/200705/33085.html

Response. Write ("client operating system:" + request. browser. Platform + "<br>"); // winnt

Response. Write ("browser used by the Client:" + request. browser. browser + "<br>"); // IE

Response. Write ("client browser version:" + request. browser. Version + "<br>"); // 6.0

Response. Write ("client Framework Version:" + request. browser. clrversion. tostring () + "<br>"); // 2.0.50727

Response. Write ("whether the client browser has a back button:" + request. browser. hasbackbutton. tostring () + "<br>"); // true

Response. write ("Judge client browser type:" + request. browser. isbrowser ("ie "). tostring () + "<br>"); // true (Case Insensitive)

Response. Write ("determine the number of machines on the client:" + (request. browser. Win16 = true )? "16-bit server": "32-bit server") + "<br>"); // 32-bit Server

// Response. Write ("" + request. contentencoding. encodingname + "<br> ");

 

 

Response. Write ("applicationpath application root path:" + request. applicationpath + "<br>"); // study1

Response. Write ("apprelativecurrentexecutionfilepath:" + request. apprelativecurrentexecutionfilepath + "<br> ");//~ /Default. aspx

Response. Write ("currentexecutionfilepath: the virtual path of the current request:" + request. currentexecutionfilepath + "<br>"); // study1/textpath/path. aspx

Response. Write ("appdomain. currentdomain. basedirectory:" + appdomain. currentdomain. basedirectory + "<br>"); // C: documents and settingsadministratormy documentsvisual Studio 2005

Response. Write ("original URL address (including URL parameters) request. rawurl" + request. rawurl + "<br>"); // study1/default3.aspx? Type = dddd

Response. Write ("physical file path physicalpath:" + request. physicalpath + "<br>"); // C: documents and settingsadministratormy documentsvisual studio 2005websitesstudy1default3. aspx

Response. Write ("physical file path of the application root directory physicalapplicationpath:" + request. physicalapplicationpath + "<br>"); // C: documents and settingsadministratormy documentsvisual studio 2005websitesstudy1

Response. Write ("assembly path: appdomain. currentdomain. relativesearchpath" + appdomain. currentdomain. relativesearchpath + "<br>"); // C: documents and settingsadministratormy documentsvisual studio 2005websitesstudy1in

Response. write ("the physical path corresponding to the virtual path server. mappath "+ server. mappath ("default3.aspx") + "<br>"); // C: documents and settingsadministratormy documentsvisual studio 2005websitesstudy1default3. aspx

Response. write ("Get the absolute URI: request. URL. absoluteuri "+ request. URL. absoluteuri. tostring () + "<br>"); // http: // localhost: 1035/study1/default3.aspx? Type = dddd

 

Response. Write ("Get Host Name: Port Number" + request. url. Authority + "<br>"); // localhost: 1035

Request. saveas (request. physicalapplicationpath + "ABC. xml", true); // save
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.