Update JSON file C# W8 development

Posted by AndrewB on Stack Overflow See other posts from Stack Overflow or by AndrewB
Published on 2012-11-13T22:57:18Z Indexed on 2012/11/13 22:59 UTC
Read the original article Hit count: 223

Filed under:
|
|

At the moment, I've got a JSON file with content looking like this:

{
"username": "test", 
"someNumber":100
}  

I'm using JSON.Net to fetch the .JSON file from a webserver - C#:

        var http = new HttpClient();
        http.MaxResponseContentBufferSize = Int32.MaxValue;
        var response = await http.GetStringAsync(URI);

        var result = JsonConvert.DeserializeObject<DatClass.Result>(response);

This works great together with the class getting/setting the properties. However, what I would like to know is whether there's a good way for a user to update the .JSON file through a textbox UI? As in:

[textbox - update username] [update button] -> username sent to server -> .JSON file updated -> [textblock - showing updated username in UI].

I'm not looking for exact code solutions, I'm rather looking for good solutions on this, and/or if this is a terrible idea of an easy database(?).

© Stack Overflow or respective owner

Related posts about c#

Related posts about windows-8