Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在编写一个 Mono 应用程序,并希望找到 Documents 文件夹的完整路径 - 例如/Users/johnsmith/Documents/. 实现这一目标的最佳方法是什么?
/Users/johnsmith/Documents/
你可以这样做:
string doc_path = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.Personal), "Documents");
(顺便说一句,对于 MonoTouch,它只是Environment.GetFolderPath (Environment.SpecialFolder.Personal))。
Environment.GetFolderPath (Environment.SpecialFolder.Personal)