几种方法如下:非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(); -----------------------------------------
非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