/// <summary> /// 执行JS
/// this.ExecuteScript("get('{0}')".FormatWith(token0), File.ReadAllText(Server.MapPath("./encodejs.js"))).toUrlEncode(); /// </summary> /// <param name="sExpression">参数体</param> /// <param name="sCode">JavaScript代码的字符串</param> /// <returns></returns> public string ExecuteScript(string sExpression, string sCode) { MSScriptControl.ScriptControl scriptControl = new MSScriptControl.ScriptControl(); scriptControl.UseSafeSubset = true; scriptControl.Language = "JScript"; scriptControl.AddCode(sCode); try { string str = scriptControl.Eval(sExpression).ToString(); return str; } catch (Exception ex) { string str = ex.Message; } return null; }
var get = function (a) { var b = CryptoJS.MD5(dfgsd); var c = CryptoJS.enc.Utf8.parse(b); var d = CryptoJS.enc.Utf8.parse(rgfgb); var e = CryptoJS.AES.encrypt(a, c, { iv: d, mode: CryptoJS.mode.CBC, padding: CryptoJS.pad.ZeroPadding }); return e.toString() }