2
Hello, I have this code:
Imports System.IO
Imports Newtonsoft.Json.Linq
Public Class Form1
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Dim channel As JObject = JObject.Parse(File.ReadAllText("C:\stats.json"))
Dim points = channel.GetValue("points").ToString()
Label1.Text = points
End Sub
And I have a button, which, in this case, I want every time it’s pressed, to add +30 on points.
How to do this? Thanks in advance.
The only place where it has the value of
pointsis in aLabel? There’s no class where you store it?– João Martins
No, there is a module. But I want to add 30 more points to the JSON by clicking the button.
– João Lucas
Ha, in JSON! IE, you want to take the object that came from your JSON file, add 30 and then re-save the file but with the
pointsupdated? That’s it?– João Martins
Yes! That’s right, that’s right!
– João Lucas