非Web程序获取路径几种方法如下: 1.AppDomain.CurrentDomain.BaseDirectory 2.Environment.CurrentDirectory 3.HttpRuntime.BinDirectory The path to the current application's/bin directory: Web程序 HttpCurrent.Context.Server.Mappath() HttpContext.Current返回当前请求的 HttpCo
ASP.NET提供了静态属性System.Web.HttpContext.Current,因此获取HttpContext对象就非常方便了.也正是因为这个原因,所以我们经常能见到直接访问System.Web.HttpContext.Current的代码: using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace Test_HttpContext.Current { p