In Mono, how do I get the path to the Documents folder on a Mac (Snow Leopard)?
-
20-09-2019 - |
Question
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?
Solution
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)
).
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow