En Mono, comment puis-je obtenir le chemin vers le dossier Documents sur un (Snow Leopard) Mac?
-
20-09-2019 - |
Question
J'écris une application Mono et je voudrais trouver le chemin complet du dossier Documents - par exemple /Users/johnsmith/Documents/
. Quelle est la meilleure façon d'y parvenir?
La solution
Vous pouvez faire ceci:
string doc_path = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.Personal), "Documents");
(BTW, pour MonoTouch, Il est juste Environment.GetFolderPath (Environment.SpecialFolder.Personal)
).
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow