In Mono, how do I get the path to the Documents folder on a Mac (Snow Leopard)?

梦想与她 提交于 2019-12-07 14:55:48

问题


I'm writing a Mono application and would like to find the full path of the Documents folder - e.g. /Users/johnsmith/Documents/. What's the best way to achieve this?


回答1:


You can do this:

string doc_path = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.Personal), "Documents");

(Btw, for MonoTouch, It's just Environment.GetFolderPath (Environment.SpecialFolder.Personal)).



来源:https://stackoverflow.com/questions/1933975/in-mono-how-do-i-get-the-path-to-the-documents-folder-on-a-mac-snow-leopard

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!