C# 将数据写入当前程序安装目录某文件夹下
2014-01-08 09:46
232 查看
public static string GetXmlFullPath(string strPath) { string filePath = GetPhysicalPath(); if (filePath.IndexOf(":") > 0) { return filePath; } else { return null; } } //获取配置文件的物理路径 public static string GetPhysicalPath() { //获得当前程序运行的物理路径比如F:\XFU.NSQS\project\Application\ string filePath = HttpContext.Current.Request.PhysicalApplicationPath; int n = filePath.IndexOf("获取程序安装文件夹下某个文件名AA"); ; filePath = filePath.Substring(0,n) + "获取程序安装文件夹下某个文件名AA" + "\\文件夹AA下的某个xml文件(用来存储相关信息)"; return filePath; }
相关文章推荐
- C# 判断是不是闰年
- C# 根据月份来确定每月的最大天数
- C#使用vs2010封装DLL
- 遍历获取Xml子节点值
- 获取Xml中指定子节点值
- C# POST 发送XML(返回string中可能出现中文乱码问题)
- C#中各种编码格式的区别
- C# XML本地文件转换成XML字符串
- Substring的用法
- 获取对固定列不重复的新DataTable
- C# index of 用法(转载)
- C# 将日志写入文本文件
- C# 将字符串(符合xml格式)转换为XmlDocument
- C# POST XML(修正中文乱码问题)
- string.Format
- C# 将XmlDocument转化为string函数
- C# POST 发送XML(返回string中可能出现中文乱码问题)
- C# XML本地文件转换成XML字符串
- C# 将XmlDocument转化为string函数
- C# POST XML(修正中文乱码问题)