This should be a start.
Code:
JObject jobject = JObject.Parse(new WebClient().DownloadString("http://ip-api.com/json/" + proxy.Split(':')[0]));
//The WebClient class implements IDisposable, which means it should be disposed after it has been used. Currently you aren't disposing //of your WebClient which can cause issues later on.
//You can also make use of string Interpolation which is a lot cleaner in my opinion, more so it useful if you adding or calling more //than 1 function or variable within a string. - it is marked with the '$' symbol before the quotes for your string.
//It's also good practice to make sure a value is assigned to that variable before doing anything with it.
string response;
using (var webClient = new WebClient())
{
response = webClient.DownloadString($"http://ip-api.com/json/{proxy.Split(':')[0]}");
} // the webclient will automatically dispose here as its using the 'using' keyword. Any class which implements IDisposable should be used as such, avoid doing anything in the using block which doesn't require the class being used.
if (!string.IsNullOrEmpty(response)) // if the string is not null or empty
{
dynamic jObject = JObject.Parse(response);
// string country = (string)jObject["regionName"]; // becomes below.
// when parsing JSON you can mark the variable you are trying to get as dynamic
dynamic means that you don't have to set the type statically, it will be resolved at runtime.
var country = jObject.regionName.ToString();
var validity = jObject.status.ToString();
}
//I wont rewrite your whole code because that is useless. You won't learn anything just by copying me.
//The switch is a good addition much better than If else a bunch of times.
//Another thing I would like to discuss is your empty Catch block, this is completely useless as it's just Pokemon gotta catch em all.
//Instead you should be handling your exceptions correctly. perhaps even log them to a .txt file, I have a class for this if you want //it just let me know and I'll share it.