Xamarin下获得各平台应用所在文件夹路径的方法

Android:

// /files
string path = Environment.GetFolderPath(Environment.SpecialFolder.Personal);

iOS:

// /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:

// \local
string path = Windows.Storage.ApplicationData.Current.LocalFolder.Path;

你可能感兴趣的:(Xamarin下获得各平台应用所在文件夹路径的方法)