var result=CryptoJS.AES.decrypt(data,name).toString(CryptoJS.enc.Utf8);
我尝试使用 cryptojs
. 我想在 c# 中使用此代码。为此需要/需要哪些图书馆/图书馆?它给出了错误CryptoJs does not exist in current context
。
我用这个
公共静态无效主要(字符串[]参数){
Class1 class1obj = new Class1();
string baseUrl = "http://www.whatsonindia.com";
WebRequest request = HttpWebRequest.Create(baseUrl);
WebResponse response = request.GetResponse();
string cookiesVals = response.Headers[HttpResponseHeader.SetCookie];
string url = "http://www.whatsonindia.com/appi/user?channelgenre=all&context=applicationname%3Dsourcebits%3Bheadendid%3D0&dateselected=0&mode=getTVGuideInfo&pageno=1&responseformat=json&responselanguage=English&starthour=0&totalhrdata=24&userid=-1";
WebClient client = new WebClient();
client.Headers.Add(HttpRequestHeader.Cookie, cookiesVals);
var data = client.DownloadString(url);
Console.WriteLine(data);
Console.WriteLine("dynamic object....");
Console.ReadLine();
JavaScriptSerializer serializer = new JavaScriptSerializer();
dynamic item = serializer.Deserialize<object>(data);
string name = item["pki"];
//JavaScriptSerializer serializer1 = new JavaScriptSerializer();
var result=CryptoJS.AES.decrypt(data,name).toString(CryptoJS.enc.Utf8);
var obj = (JObject)JsonConvert.DeserializeObject(data);
// var dict = obj.First.First.Children().Cast<JProperty>().ToDictionary();
var dt = (string)obj["data"];
Console.WriteLine(dt);
Console.ReadLine();
}