This is my first time using a library outside of .NET let-alone JSON.Net so excuse my beginner question. I am trying to deserialize some AWS data into an object using the JSON.Net library but keep getting this error specifically with the IP address in the json file.
Example AWS Data
{
"ip_prefix": "205.251.254.0/24",
"region": "GLOBAL",
"service": "CLOUDFRONT"
},
{
"ip_prefix": "216.137.32.0/19",
"region": "GLOBAL",
"service": "CLOUDFRONT"
}
Here is an example of my C#:
class AWS
{
public string ipprefix;
public string region;
public string service;
}
class DataGathering
{
public List<AWS> GetIPData(string filename)
{
List<AWS> ipdata = new List<AWS>();
using (StreamReader reader = new StreamReader(filename))
{
string json = reader.ReadToEnd();
ipdata = JsonConvert.DeserializeObject<List<AWS>>(json);
}
return ipdata;
}
Any help is much appreciated