首页 / 更多教程 / HttpRuntime应用程序运行时
HttpRuntime应用程序运行时
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了HttpRuntime应用程序运行时,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含3284字,纯文字阅读大概需要5分钟。
内容图文
![HttpRuntime应用程序运行时](/upload/InfoBanner/zyjiaocheng/654/1fafb502892445b18c6624e3fa80994d.jpg)
System.Web.HttpRuntime类是整个Asp.net服务器处理的入口。
这个类提供了一系列的静态属性,反映web应用程序域的设置信息,而且每个web应用程序域中存在一个System.Web.Runtime类。
1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Web; 6 using System.Web.UI; 7 using System.Web.UI.WebControls; 8 9 namespace HttpRuntimeDemo 10 { 11 public partial class _default : System.Web.UI.Page 12 { 13 protected void Page_Load(object sender, EventArgs e) 14 { 15 StringBuilder sb = new StringBuilder(); 16 //应用程序域id 17 sb.AppendFormat("AppDomainAppId:{0}<br/>", HttpRuntime.AppDomainAppId); 18 //web应用程序所在文件目录 19 sb.AppendFormat("AppDomainAppPath:{0}<br/>", HttpRuntime.AppDomainAppPath); 20 //web应用程序的虚拟目录 21 sb.AppendFormat("AppDomainAppVirtualPath:{0}<br/>", HttpRuntime.AppDomainAppVirtualPath); 22 //客户端脚本在服务器上的文件目录 23 sb.AppendFormat("AspClientScriptPhysicalPath:{0}<br/>", HttpRuntime.AspClientScriptPhysicalPath); 24 //客户端脚本在服务器上的虚拟目录 25 sb.AppendFormat("AspClientScriptPhysicalPath:{0}<br/>", HttpRuntime.AspClientScriptVirtualPath); 26 //asp.net安装目录 27 sb.AppendFormat("AspInstallDirectory:{0}<br/>", HttpRuntime.AspInstallDirectory); 28 //bin目录 29 sb.AppendFormat("BinDirectory:{0}<br/>", HttpRuntime.BinDirectory); 30 //clr安装目录 31 sb.AppendFormat("ClrInstallDirectory:{0}<br/>", HttpRuntime.ClrInstallDirectory); 32 //生成代码的目录 33 sb.AppendFormat("CodegenDir:{0}<br/>", HttpRuntime.CodegenDir); 34 //iss版本 35 sb.AppendFormat("IISVersion:{0}<br/>", HttpRuntime.IISVersion.MajorRevision.ToString()); 36 //本机配置文件所在的目录 37 sb.AppendFormat("MachineConfigurationDirectory:{0}<br/>", HttpRuntime.MachineConfigurationDirectory); 38 //是否使用iis7集成模式 39 sb.AppendFormat("UsingIntegratedPipeline:{0}<br/>", HttpRuntime.UsingIntegratedPipeline.ToString()); 40 // Summary: 41 // Gets a value that indicates whether the application is mapped to a universal 42 // naming convention (UNC) share. 43 sb.AppendFormat("IsOnUNCShare:{0}<br/>", HttpRuntime.IsOnUNCShare.ToString()); 44 Response.Write(sb.ToString()); 45 46 } 47 } 48 }
上面列出了HttpRuntime主要的几个静态属性,输出结果为:
而HttpRuntime的静态方法ProcessRequest将帮助我们处理Http请求。
1 // 2 // Summary: 3 // Drives all ASP.NET Web processing execution. 4 // 5 // Parameters: 6 // wr: 7 // An System.Web.HttpWorkerRequest for the current application. 8 // 9 // Exceptions: 10 // System.ArgumentNullException: 11 // The wr parameter is null. 12 // 13 // System.PlatformNotSupportedException: 14 // The Web application is running under IIS 7 in Integrated mode. 15 public static void ProcessRequest(HttpWorkerRequest wr);
转:https://www.cnblogs.com/wolf-sun/p/5199315.html
内容总结
以上是互联网集市为您收集整理的HttpRuntime应用程序运行时全部内容,希望文章能够帮你解决HttpRuntime应用程序运行时所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。