Beispiel #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();
        }
 public static string AnalyseToken(this string original)
 {
     try
     {
         return(HashEncryptHepler.DecryptAESToString(original, _tokenPW, Encoding.UTF8.GetBytes(_tokenIV)));
     }
     catch
     {
         return(string.Empty);
     }
 }
Beispiel #3
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);
        }
Beispiel #4
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();
            //PushAndroidMsg(PushType.CustomizedCast, true, null, "", "测试测试", "测试内容", "", "12606278");
            //PushIosMsg(PushType.CustomizedCast,false,null,"","测试测试","测试内容","","d9e81235a11e4328a6d73ac104ff57d6");
            //PushMessage(PushType.BroadCast, "", "", "测试", "测试umeng广播", "测试umeng", "1");
            //var a = HAHA();
            //var b = HA();
        }
        public MainWindow()
        {
            InitializeComponent();
            DataContext = this;

            //var a = HashEncryptHepler.MD5Hash(HashEncryptHepler.MD5Hash("13321952950I4kl$0bs"));
            var b = Encoding.Default.GetString(Convert.FromBase64String("eVRkd3JodWpNWjJmemhNWmVkaVJKWjlBNk45RFZReWw="));
            //var a = HashEncryptHepler.EncryptAESToBase64("10000115", b, b.Substring(0, 16));
            var a = HashEncryptHepler.DecryptAESToString("m/ikMq4WOWlEqHUcj2XalA==", b, b.Substring(0, 16));
            //var c = HashEncryptHepler.DecryptAESToStringCore(b, ")O[xx]6,YF}+eecaj{+oESb7d8>Z'e9N", "UXS9rr9^1wUBzVu#");
            //var a = "cM067Ca06ivfYFjcJyUwHQjyhNydLioNn5tLbr7ac3uRTH0z/iP2wSdkICSxEgw3".AnalyseToken();
            //ListNode = new ThreadSafeObservableCollection<Node>();
            //ListNode.CollectionChanged += ListNode_CollectionChanged;
            //TestSql.Test();
            //ListType.WriteJson("appSettings.json");
        }
Beispiel #6
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 啊  = HashEncryptHepler.EncryptAESToBase64("abcd1234qqqaaazzz222wwwssxx333", "_accessToken", "AqIm%czX6M20mi8w");
            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.GetUsers();
            //var b = MsgServiceClient.Send();
            //var c = MsgServiceClient.AddUserLog();
            //var d = MsgServiceClient.GetUser();
            //PushAndroidMsg(PushType.CustomizedCast, true, null, "", "测试测试", "测试内容", "", "12606278");
            //PushIosMsg(PushType.CustomizedCast,false,null,"","测试测试","测试内容","","d9e81235a11e4328a6d73ac104ff57d6");
            //PushMessage(PushType.BroadCast, "", "", "测试", "测试umeng广播", "测试umeng", "1");
            //var a = HAHA();
            //var b = HA();
        }