您当前的位置: 首页 >  c#

衣舞晨风

暂无认证

  • 0浏览

    0关注

    1156博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

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

衣舞晨风 发布时间:2014-01-08 09:46:44 ,浏览量:0

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

关注
打赏
1647422595
查看更多评论
立即登录/注册

微信扫码登录

0.0405s