在Windows Phone8.1中以编程方式编辑Json文件
本文关键字:方式 编辑 Json 文件 编程 Windows Phone8 | 更新日期: 2023-09-27 18:10:21
{
"DrinksItems": [
{
"UniqueId": "Drinks-Item-1",
"Title": "After Five",
"ImagePath": "Assets/Drinks/AfterFive.png",
"Description": "An After Five is a popular shooter that is often ...",
"Ingredients": "1/2 oz (15ml) coffee liqueur",
"Alcohol": "8.89",
"Vodka": false,
"Gin": false,
"Whisky": false,
"Beer": false,
"Rum": false,
"Wine": false,
"Brandy": false,
"Tequila": false,
"Favorite": false,
"Popular": false,
"Glass": "Shot",
"Category": "Creamy Sour-Cream drink"
},
我想在按钮后单击更改收藏从false到true在JSON文件。我怎么能做到??
JSON文件没有什么特别之处。你不能像在数据库中那样更新单个值。它只是一个文本文件,所以你必须阅读它,更新它,并保存它,就像任何其他文本文件。