This is how my json looks like:

I created the following code:
public class user
{
public string username { get; set; }
public int userid
{
get;
set;
}
public string red
{
get;
set;
}
public string acompaccompelted_setup
{
get;
set;
}
}
To get the data from URL I used the following code:
string url = "localhost/testingdata/file.json";
HttpWebRequest request = WebRequest.Create(url) as HttpWebRequest;
string jsonValue = "";
using (HttpWebResponse response = request.GetResponse() as HttpWebResponse)
{
StreamReader reader = new StreamReader(response.GetResponseStream());
json = reader.ReadToEnd();
}
user listing = JsonConvert.DeserializeObject<user>(json);
Console.WriteLine(listing.username);
Console.ReadLine();
Unfortunately, I'm not able to get the value for the string "username". It returns an empty value. If I try to use :
List<user> items = JsonConvert.DeserializeObject<List<user>>(json);
Then I'm getting another error. If I call the:
Console.WriteLine(json);
Then I'm getting the complete list of JSON. But I want to extract the username only. I tried to follow steps given here https://www.c-sharpcorner.com/article/working-with-json-in-C-Sharp/ but with no success. What I'm doing wrong?