在Mono中,如何获取Mac(Snow Leopard)上的Documents文件夹的路径? [英] In Mono, how do I get the path to the Documents folder on a Mac (Snow Leopard)?

查看:156
本文介绍了在Mono中,如何获取Mac(Snow Leopard)上的Documents文件夹的路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写Mono应用程序,并希望找到Documents文件夹的完整路径-例如/Users/johnsmith/Documents/.实现此目标的最佳方法是什么?

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?

推荐答案

您可以执行以下操作:

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

(顺便说一句,对于MonoTouch,它只是Environment.GetFolderPath (Environment.SpecialFolder.Personal)).

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

这篇关于在Mono中,如何获取Mac(Snow Leopard)上的Documents文件夹的路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆