我正在尝试解析 json。我收到以下异常:
An exception of type 'System.ArgumentException' occurred in Newtonsoft.Json.Silverlight.DLL but was not handled in user code
我的 C# 代码是
private void imgloginbtn_Tap_1(object sender,
System.Windows.Input.GestureEventArgs e) {
///set flag in app.xaml for popup
var obj = App.Current as App;
obj.Popupflag = true;
//WhatsupServices.WhatsUpServiceSoapClient ws =
//new WhatsupServices.WhatsUpServiceSoapClient();
WhatsupServices.WhatsUpServiceSoapClient ws =
new WhatsupServices.WhatsUpServiceSoapClient();
ws.ChangePasswrdJsonCompleted += ws_ChangePasswrdJsonCompleted;
ws.ChangePasswrdJsonAsync("man", "man", "man");
}
void ws_ChangePasswrdJsonCompleted(object sender,
WhatsupServices.ChangePasswrdJsonCompletedEventArgs e) {
string s = e.Result;
JObject obj = JObject.Parse(s);
string ResultCode = (string) obj["ResultCode"];
string ResponceMessage = (string) obj["ResponseMessage"];
}
当我试图获取 Resultcode 时发生异常
帮助我如何解决这个问题?