《程序员的第一年》---------- C# 在非web程序取目录笔记
2013-05-21 11:20
411 查看
///// <summary> ///// 在非web程序取目录 ///// </summary> ///// <param name="strPath"></param> ///// <returns></returns> //private string MapPath(string strPath) //{ // if (HttpContext.Current != null) // { // return HttpContext.Current.Server.MapPath(strPath); // } // else //非web程序引用 // { // strPath = strPath.Replace("/", "\\"); // if (strPath.StartsWith("\\")) // { // //strPath = strPath.Substring(strPath.IndexOf('\\', 1)).TrimStart('\\'); // strPath = strPath.TrimStart('\\'); // } // return System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, strPath); // } //}
相关文章推荐
- [转]C#取得Web程序和非Web程序的根目录的N种取法
- C#获取Web和非Web程序的目录
- 取得Web程序和非Web程序的根目录的N种取法(C#)
- C#取得Web程序和非Web程序的根目录的N种取法
- C#获取Web和非Web程序的目录
- C#获取Web和非Web程序的目录
- C#取得Web程序和非Web程序的根目录的N种取法
- [总结]取得Web程序和非Web程序的根目录的N种取法(C#)
- 《程序员的第一年》---------- C# 获得目录的一些方法
- C#笔记(17)程序只运行一个实例
- c# 应用程序获取当前程序运行根目录
- C#中得到程序当前工作目录和执行目录的五种方法
- 程序员简单打造一个灵活智能的自动化运维系统C#实例程序
- C#中得到程序当前工作目录和执行目录的一些方法
- C#笔记(从程序中输出文本)1
- 【C#】C#学习笔记之程序集
- C#如何加载程序运行目录外的程序集
- [目录][C#笔记]---第一节 数据类型
- C# 学习笔记 -- 第五天 程序结构
- 《程序员的第一年》---------- 学会抛出异常 你的程序人生才幸福