【发布时间】:2017-04-10 09:42:40
【问题描述】:
我正在使用 Xamarin 开发我的应用程序。我看到了很多答案,但没有找到可以帮助我的东西。如何获取位于 sdcard0 中的应用程序文件夹的路径?我想得到类似的东西:/storage/sdcard0/Android/data/[MyApplication]/files。
我做了以下事情:
var path = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
它给了我"/data/data/App1.Droid/files",但它不是我要找的。
【问题讨论】:
-
我用的是Android Studio,你可以试试
Environment.getExternalStorageDirectory().getAbsolutePath() -
使用
getCanonicalPath()。请参阅this 接受我的评论作为答案! ;D