{"Score":"1851","HistoryScore":"3149","TotalScore":"3149","TotalTopic":"289"}
Bild haben ein über jsonJtoken werfen Fehler
int i = (int)x["Score"]
das ist in Ordnung, und i = 1851 bis int;
Wenn eine Erweiterungsmethode hat als nächste
public static T As<T>(this object @this)
{
return (T) @this;
}
x["Score"].as<int>();`
// this will get error why? System.InvalidCastException
Es ist schon [ 'JToken.ToObject()'] (http://www.newtonsoft.com/json/help/html/M_Newtonsoft_Json_Linq_JToken_ToObject__1. htm). –
dbc