I have problem with json (i never touch json before). My code is basically copy paste of this Read and parse a Json File in C#.
using (StreamReader r = new StreamReader(RandomUtils.launcherPath() + @"\users.json"))
{
string json = r.ReadToEnd();
List<Account> items = JsonConvert.DeserializeObject<List<Account>>(json);
}
public class Account
{
public string users;
public string username;
public string type;
public string uuid;
public string sessionToken;
public string accessToken;
}
and my json (block at users)
{
"users": {
"quinn23513@gmail.com": {
"username": "quinn23513@gmail.com", //Just bug here ill fix later
"type": "mojang",
"uuid": "008d8151613d4ef4bf491520f90930c1",
"sessionToken": "token",
"accessToken": "Anothertoken"
}
}
}