日期:2014-05-17 浏览次数:20498 次
string url = "";
string mess = "";
string message=GetHtmlContentByUrl(url,mess);
JavaScriptSerializer serializer = new JavaScriptSerializer();
Dictionary<string, object> json = (Dictionary<string, object>)serializer.DeserializeObject(message);
object value;
//这里一直都是NULL,对json不熟
//断点调试,message={"Result":{"UserID":"","UserName":"13451857779","UserRole":"测试","UserLevel":"15","Status":1}}
if (json.TryGetValue("UserLevel", out value))
{
string aaa =value.ToString();
}
var message = { "Result": { "UserID": "", "UserName": "13451857779", "UserRole": "测试", "UserLevel": "15", "Status": 1} }
message = eval(message);
alert(message.Result.UserLevel);