I've been reading for hours and still can't figure out how to use this under my button I have
WebClient wc = new WebClient(); Uri uri = new Uri("url"); string json = wc.DownloadString(uri); var a = JsonConvert.DeserializeObject<RootObject>(json); and the classes
public class Shares { public int valid { get; set; } public int invalid { get; set; } public int id { get; set; } public int donate_percent { get; set; } public int is_anonymous { get; set; } public string username { get; set; } } public class Transactions { public double Credit { get; set; } public double Debit_MP { get; set; } public double Fee { get; set; } public int TXFee { get; set; } } public class Data { public string username { get; set; } public Shares shares { get; set; } public int hashrate { get; set; } public string sharerate { get; set; } public Transactions transactions { get; set; } } public class Getuserstatus { public string version { get; set; } public double runtime { get; set; } public Data data { get; set; } } public class RootObject { public Getuserstatus getuserstatus { get; set; } } I did a messagebox to check the string from the URL and all the data is there but it doesn't put it into the fields when I call them they're all empty
Shares Share = new Shares(); textBox1.Text += "Username: " + Share.username; edit: ok I got it working the a.getsuerstatus.data.shares.username is not valid in the api I don't know why jsontocsharp site added it but all the data is there username is actually a.getuserstatus.data.username thank you all for the help or I would have still be trying to call data using Shares Share = new Shares()