例如:
Path.GetFullPath(Path.Combin(@"C:ac","...text"));
..代表上级目录
.代表当前目录
结果:
c:a.text
在winform中项目所在目录:D:MyWorkMyProject
string strpath=System.Windows.Forms.Application.StartupPath;
结果:
strpath: D:MyWorkMyProjectinDebug
string _path=Path.GetFullPath(Path.Combin(strpath,"...text"));
结果:
_path: D:MyWorkMyProjectin.text
string _path2=Path.GetFullPath(Path.Combin(strpath,".....text"));
结果:
_path2: D:MyWorkMyProject.text