Xamarin下获得各平台应用所在文件夹路径的方法
2017-09-30 本文已影响60人
临岁之寒
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;