Xamarin下获得各平台应用所在文件夹路径的方法
Android:
// <AppHome>/files
string path = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
iOS:
// <AppHome>/Documents
string docFolder = Environment.GetFolderPath(Environment.SpecialFolder.Personal); // to meet Apple’s iCloud terms, content that is not generated by the user
// should be placed in the /Library folder or a subdirectory inside it
string libFolder = System.IO.Path.Combine(docFolder,"..", "Library");
WindowPhone:
// <AppHome>\local
string path = Windows.Storage.ApplicationData.Current.LocalFolder.Path;
- 原文作者:岁寒
- 原文链接:http://www.suihanime.com/post/Xamarin/Xamarin%E4%B8%8B%E8%8E%B7%E5%BE%97%E5%90%84%E5%B9%B3%E5%8F%B0%E5%BA%94%E7%94%A8%E6%89%80%E5%9C%A8%E6%96%87%E4%BB%B6%E5%A4%B9%E8%B7%AF%E5%BE%84%E7%9A%84%E6%96%B9%E6%B3%95/
- 版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 4.0 国际许可协议进行许可,非商业转载请注明出处(作者,原文链接),商业转载请联系作者获得授权。