I'm using Json.net and this is my json:
{
"miner": "t1biSMuXyq5eKkP8zDPViKHF9mbS9ZFLRuF",
"totalHash": 1523943880.832757,
"totalShares": 4089.53223605,
"networkSols": "7644579",
"immature": 0.29784511,
"balance": 0,
"paid": 1092.22974323,
"workers": {
"t1biSMuXyq5eKkP8zDPViKHF9mbS9ZFLRuF": {
"name": "t1biSMuXyq5eKkP8zDPViKHF9mbS9ZFLRuF",
"diff": 54500,
"shares": 106.44625040000004,
"invalidshares": 0,
"currRoundShares": 4082.8793454,
"currRoundTime": 0,
"hashrate": 1523943880.832757,
"hashrateString": "3.05 KSol/s",
"luckDays": "5.574",
"luckHours": "133.768",
"paid": 1092.22974323,
"balance": 0
}
},
"history": {
"t1biSMuXyq5eKkP8zDPViKHF9mbS9ZFLRuF": [
{
"time": 1516522247,
"hashrate": 1600923951.4915187
},
{
"time": 1516526867,
"hashrate": 1523943880.832757
}
]
}
}
I would like to get element hashrateString inside "workers" and inside "t1biSMuXyq5eKkP8zDPViKHF9mbS9ZFLRuF" but the "t1biSMuXyq5eKkP8zDPViKHF9mbS9ZFLRuF" changes every time.
This is my current code:
String dl = webClient.DownloadString("http://hushpool.cloud/api/worker_stats?t1biSMuXyq5eKkP8zDPViKHF9mbS9ZFLRuF");
JObject json = JObject.Parse(dl);
JObject workers = JObject.Parse(JObject.Parse(dl).SelectToken("workers").First.ToString());
label7.Text = (String)json.GetValue("balance");
label8.Text = (String)json.GetValue("pending");
label9.Text = (String)json.GetValue("paid");
label10.Text = (String)workers.GetValue("hashrateString");
I've tried different codes but nothing worked. Could you guys help me?