日期:2014-05-18  浏览次数:20766 次

关于获取文件路径的问题,求助!
我用openfiledialog打开文件后,会生成一个存储前面所选取的文件路径的文件,然后我要把这个生成的文件放在openfiledialog所打开文件的上一级目录,这个路径(openfiledialog选取的文件的上一级目录)要怎么写


------解决方案--------------------
System.IO.Path.GetDirectoryName(System.IO.Path.GetDirectoryName(openfiledialog.FileName))
------解决方案--------------------
System.IO.Path.GetDirectoryName("strPath");

如何还要上级System.IO.Path.GetDirectoryName(System.IO.Path.GetDirectoryName("strPath"));