1. 获取绝对文件路径
代码如下:
System.IO.Path.GetFullPath(string path)
string fileName = “myfile.ext”;
string path1 = @”mydir”;
string path2 = @”\mydir”;
string fullPath;
fullPath = Path.GetFullPath(path1);
fullPath = Path.GetFullPath(fileName);
fullPath = Path.GetFullPath(path2);
除声明外,跑步客文章均为原创,转载请以链接形式标明本文地址
C#中的文件路径获取函数和文件名字获取函数小结
本文地址: http://www.paobuke.com/develop/c-develop/pbk23175.html
C#中的文件路径获取函数和文件名字获取函数小结
本文地址: http://www.paobuke.com/develop/c-develop/pbk23175.html