JavascriptAction这个是什么东东
public List<GroupInfo> GetGroupInfos() { if (!isLogin) Login(); List<GroupInfo> giList = new List<GroupInfo>(); string json = GetWebData<string>(string.Format(groupListUrl, JavascriptAction.Random())); try { var jsonObj = JavaScriptEngine.Run("var m=" + json + ";m.c") as Dictionary<string, object>; foreach (var key in jsonObj.Keys) { var gi = (jsonObj[key] as Dictionary<string, object>); if (!gi.ContainsKey("owner")) continue; string owner = gi["owner"].ToString(); string name = gi["name"].ToString(); string max_member = gi["max_member"].ToString(); string create_time = gi["create_time"].ToString(); string notice = gi["brief"].ToString(); string number = key; string memo = gi["memo"].ToString(); giList.Add(new GroupInfo() { CreateTime = JavascriptAction.GetTimeByJsTime(Convert.ToInt64(create_time)), MaxNumber = Convert.ToInt32(max_member), Memo = memo, Name = name, Notice = notice, Number = number, Owner = owner }); } } catch { } return giList; }
话说第5行的JavascriptAction和第8行的JavaScriptEngine是什么意思,度娘竟然没找到
--------------------编程问答--------------------
public List<GroupInfo> GetGroupInfos()
{
if (!isLogin) Login();
List<GroupInfo> giList = new List<GroupInfo>();
string json = GetWebData<string>(string.Format(groupListUrl,
JavascriptAction.Random()));
try
{
var jsonObj = JavaScriptEngine.Run("var m=" + json + ";m.c") as Dictionary<string, object>;
foreach (var key in jsonObj.Keys)
{
var gi = (jsonObj[key] as Dictionary<string, object>);
if (!gi.ContainsKey("owner")) continue;
string owner = gi["owner"].ToString();
string name = gi["name"].ToString();
string max_member = gi["max_member"].ToString();
string create_time = gi["create_time"].ToString();
string notice = gi["brief"].ToString();
string number = key;
string memo = gi["memo"].ToString();
giList.Add(new GroupInfo()
{
CreateTime = JavascriptAction.GetTimeByJsTime(Convert.ToInt64(create_time)),
MaxNumber = Convert.ToInt32(max_member),
Memo = memo,
Name = name,
Notice = notice,
Number = number,
Owner = owner
});
}
}
catch { }
return giList;
}
--------------------编程问答--------------------
在上面点转到定义看看。应该是一个javascript解释器引擎。
补充:.NET技术 , C#