我正在尝试访问“成功”属性以获取其值。现在,它正在说“对象引用未设置为对象的实例”。我如何获取字符串值?
{ "success": true, "next": "/locations", "amount": 325, "keys": 3, "credits": 6185}
private static void postComplete(object sender, UploadStringCompletedEventArgs e)
{
object result = JsonConvert.DeserializeObject<object>(e.Result);
try{
PropertyInfo pi = result.GetType().GetProperty("success");
String success = (String)(pi.GetValue(result, null));
Console.Write(success);
}
catch (Exception f) {
Console.Write(f);
}