<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                windows有自帶的算法來計算MD5 原本在WPF是 ~~~ private string get_MD5(string str) { System.Security.Cryptography.MD5CryptoServiceProvider md5 = new System.Security.Cryptography.MD5CryptoServiceProvider(); byte[] temp; StringBuilder strb = new StringBuilder(); temp = md5.ComputeHash(Encoding.Unicode.GetBytes(str)); md5.Clear(); for (int i = 0; i < temp.Length; i++) { strb.Append(temp[i].ToString("X").PadLeft(2 , '0')); } return strb.ToString().ToLower(); } ~~~ 進行MD5,可是UWP沒有System.Security.Cryptography.MD5CryptoServiceProvider 在msdn是 ~~~ Windows.Security.Cryptography.Core.CryptographicHash ~~~ 來作為MD5的類 這個類只有兩個方法:Append,GetValueAndReset 不知道微軟是怎么要這樣做 弄了好久才知道要怎么去md5 下面代碼演示了三段不同字符串,經過MD5之后得到值 不過之前需要 ~~~ using Windows.Security.Cryptography; using Windows.Security.Cryptography.Core; using Windows.Storage.Streams; ~~~ 代碼 ~~~ public void ce() { //可以選擇MD5 Sha1 Sha256 Sha384 Sha512 string strAlgName = HashAlgorithmNames.Md5; // 創建一個 HashAlgorithmProvider 對象 HashAlgorithmProvider objAlgProv = HashAlgorithmProvider.OpenAlgorithm(strAlgName); // 創建一個可重用的CryptographicHash對象 CryptographicHash objHash = objAlgProv.CreateHash(); string strMsg1 = "這是一段待加密的字符串"; IBuffer buffMsg1 = CryptographicBuffer.ConvertStringToBinary(strMsg1 , BinaryStringEncoding.Utf16BE); objHash.Append(buffMsg1); IBuffer buffHash1 = objHash.GetValueAndReset(); string strHash1 = CryptographicBuffer.EncodeToBase64String(buffHash1); string strMsg2 = "和前面一串不相同的字符串"; IBuffer buffMsg2 = CryptographicBuffer.ConvertStringToBinary(strMsg2 , BinaryStringEncoding.Utf16BE); objHash.Append(buffMsg2); IBuffer buffHash2 = objHash.GetValueAndReset(); string strHash2 = CryptographicBuffer.EncodeToBase64String(buffHash2); string strMsg3 = "每個都不相同"; IBuffer buffMsg3 = CryptographicBuffer.ConvertStringToBinary(strMsg3 , BinaryStringEncoding.Utf16BE); objHash.Append(buffMsg3); IBuffer buffHash3 = objHash.GetValueAndReset(); string strHash3 = CryptographicBuffer.EncodeToBase64String(buffHash3); _reminder.Append(strMsg1 + "\r\n"); _reminder.Append(strHash1 + "\r\n"); _reminder.Append(strMsg2 + "\r\n"); _reminder.Append(strHash2 + "\r\n"); _reminder.Append(strMsg3 + "\r\n"); _reminder.Append(strHash3 + "\r\n"); } ~~~ `_reminder`是一個`StringBuilder`用于展示 這個MD5結果有英文字符和數字特殊字符 上面代碼其實也可以改為`Sha1 Sha256 Sha384 Sha512`只要在第一句的MD5改為你要的 [參考文獻:https://msdn.microsoft.com/zh-cn/library/windows/apps/xaml/windows.security.cryptography.core.cryptographichash.aspx](https://msdn.microsoft.com/zh-cn/library/windows/apps/xaml/windows.security.cryptography.core.cryptographichash.aspx) 判斷ctrl按下 ~~~ private void reminderkeydown(object sender , KeyRoutedEventArgs e) { if (e.Key == Windows.System.VirtualKey.Control) { _ctrl = true; } if (_ctrl) { xreminder.Text = "ctrl+" + e.Key.ToString(); } else { xreminder.Text = e.Key.ToString(); } } private bool _ctrl; private void reminderkeyup(object sender , KeyRoutedEventArgs e) { if (e.Key == Windows.System.VirtualKey.Control) { _ctrl = false; } } ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看