Example #1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            var nonce   = Utility.ObjectID;
            var curTime = DateTime.Now.ToLong().ToString();

            txt1.Text = nonce;
            txt2.Text = curTime;
            txt3.Text = HashEncryptHepler.SHA1Hash(txt0.Text + nonce + curTime).ToLower();
            var a = HashEncryptHepler.MD5Hash(HashEncryptHepler.MD5Hash("15604293775" + "I4kl$0bs"));
            //var b = Encoding.Default.GetString(Convert.FromBase64String("eVRkd3JodWpNWjJmemhNWmVkaVJKWjlBNk45RFZReWw="));
            //var a = HashEncryptHepler.EncryptAESToBase64("Helloworld", b, b.Substring(0, 16));
            //txt2.Text = HashEncryptHepler.DecryptAESToString(txt1.Text, b, b.Substring(0, 16));
            //var 啊1 = HashEncryptHepler.DecryptAESToString(啊, "qiK5jiZ7$rgBWVz1V*jJ!@ly7d2vxT9j", "AqIm%czX6M20mi8w");
            //Trace.WriteLine(int.Parse("001231").ToString());
            //var a = Regex.Matches("asdasd1/9/2019 3:9:9 PM", RegexExtensions.DateTimePattern());
            //var a = MsgServiceClient.Send();
            //var b = MsgServiceClient.UpdateUser();
            //var c = MsgServiceClient.AddUserLog();
            //var d = MsgServiceClient.UpdateUser();
            //var a = MsgServiceClient.Code();
            //PushAndroidMsg(PushType.CustomizedCast, true, null, "", "测试测试", "测试内容", "", "12606278");
            //PushIosMsg(PushType.CustomizedCast,false,null,"","测试测试","测试内容","","d9e81235a11e4328a6d73ac104ff57d6");
            //PushMessage(PushType.BroadCast, "", "", "测试", "测试umeng广播", "测试umeng", "1");
            //var a = HAHA();
            //var b = HA();
        }
Example #2
0
        private string InitParamsAndUrl <T>(PostUMengJson <T> paramsJsonObj) where T : class, new()
        {
            if (string.IsNullOrEmpty(paramsJsonObj.Appkey))
            {
                paramsJsonObj.Appkey = _appkey;
            }
            var json     = paramsJsonObj.ToJson(true, CaseType.Lower);
            var calcSign = HashEncryptHepler.MD5Hash(_requestMethod + _apiFullUrl + json + _appMasterSecret).ToLower();

            _apiFullUrl = string.Format("{0}?sign={1}", _apiFullUrl, calcSign);
            return(json);
        }