1
如何在C#中使用Windows.Data.Json將字符串插入到jsonArray中?我想序列化保存到我的localsettings爲Windows 8如何向JsonArray中插入字符串?
我想:
public static void saveString(String myString)
{
if (!ApplicationData.Current.LocalSettings.Values.ContainsKey("listOfStrings"))
{
JsonArray jsonArray= new JsonArray();
jsonArray.Add(myString); //error saying it is not a jsonvalue
ApplicationData.Current.LocalSettings.Values["listOfStrings"] = jsonArray.ToString();
}
}