合并的路径Path.Combine

包含合并的路径的字符串。如果指定的路径之一是零长度字符串,则该方法返回其他路径。如果 path2 包含绝对路径,则该方法返回 path2。

System.Web.HttpServerUtility util = HttpContext.Current.Server;
string path = util.MapPath(string.Format(""));
string fileName = System.IO.Path.Combine(path, "namedconnection.xml");

原文地址:https://www.cnblogs.com/zhangpengshou/p/964776.html