I am trying to save ulong[] to my json file.
This is my code:
ulong[] ts = new ulong[3];
ts[0] = 749076952626757682
ts[1] = 849076952626757682
ts[2] = 949076952626757682
var json = string.Empty;
json = File.ReadAllText(@"file.json");
dynamic jsonObj = JsonConvert.DeserializeObject(json);
jsonObj["whitelistedChannels"] = ts; //this is the line on which i'm getting the error
tring output = JsonConvert.SerializeObject(jsonObj, Formatting.Indented);
File.WriteAllText(configFile, output);
This is my json
{
"test": []
}
I want my json file to look like this:
{
"test": [749076952626757682,849076952626757682,949076952626757682]
}
How can i do that? Thanks in advance.