win8 key---value储存数据
1 public static ApplicationDataContainer localSettings = ApplicationData.Current.LocalSettings; 2 3 public static void saveData(string name, string value) 4 { 5 6 localSettings.Values[name] = value; 7 } 8 /************************* 9 *FUNC 获取对应文件名的数据 10 * 11 * ***********************/ 12 public static string getData(string name) 13 { 14 15 string data = string.Empty; 16 try 17 { 18 data = localSettings.Values[name].ToString(); 19 } 20 catch 21 { } 22 return data; 23 }
缺点只能储存小一些的数据,有点对数据的操作简单方便