阅读528 返回首页    go 阿里云 go 技术社区[云栖]


C# 将数据写入当前程序安装目录某文件夹下


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;
}


最后更新:2017-04-03 12:54:19

  上一篇:go Xml SelectNodes 与 XPath
  下一篇:go 会计札记