protected void Page_Load(object sender, EventArgs e) { //System.ServiceModel.Channels.CustomBinding binding = new System.ServiceModel.Channels.CustomBinding(); // binding.MaxReceivedMessageSize = 2147483647; DataServiceClient client = new DataServiceClient(); if (client.GetWebPredict().Length>0) { string body = client.GetWebData(); //Response.Write(body); string jsonString = DecryptAES(body, "qjkHuIy9D/9i=", "Mi9l/+7Zujhy12se6Yjy111A"); Response.Write(jsonString); //Response.Write(client.GetWebPredict()); //string abcd=System.Text.Encoding.ASCII.; // Response.Write(abc); // byte[] buffer = System.Text.Encoding.UTF8.GetBytes(body); //byte[] ss = Convert.FromBase64String(body); //string s = System.Text.Encoding.ASCII.GetString(ss); //string s = System.Text.Encoding.UTF8.GetString(ss); //string s = System.Text.Encoding.Default.GetString(ss); //string s = System.Text.Encoding.Unicode.GetString(ss); // var stream = new MemoryStream(ss); // var result = new BinaryFormatter().Deserialize(stream); //Response.Write(client.GetWebPredict().ToString()); client.Close(); } }
static void Main(string[] args) { DataServiceClient client = new DataServiceClient(); if (client.GetWebPredict().Length > 0) { string webData = client.GetWebData(); //string aaaa=webData.Replace("//",""); string jsonString = DecryptAES(webData, "qjkHuIy9D/9i=", "Mi9l/+7Zujhy12se6Yjy111A"); Console.Write(jsonString); //Console.ReadKey(); //string webPredict = client.GetWebPredict(); //JsonValue value3 = JsonValue.Parse(webPredict)["Table"]; // Console.Write(webPredict); // Console.ReadKey(); //string webAlert = client.GetWebAlert(); //Console.Write(webAlert); client.Close(); } }