win10應用 UWP 使用MD5演算法

2022-01-16 08:35:24 字數 1116 閱讀 2665

windows有自帶的演算法來計算md5

原本在wpf是

private string get_md5(string str)

return strb.tostring().tolower();

}

進行md5,可是uwp沒有system.security.cryptography.md5cryptoserviceprovider

在msdn是

windows.security

.cryptography

.core

.cryptographichash

弄了好久才知道要怎麼去md5

下面**演示了三段不同字串,經過md5之後得到值

不過之前需要

using windows.security

.cryptography

;using windows.security

.cryptography

.core

;using windows.storage

.streams

;

**

public void ce()

_reminder是乙個stringbuilder用於展示

這個md5結果有英文本元和數字特殊字元

上面**其實也可以改為sha1 sha256 sha384 sha512只要在第一句的md5改為你要的

判斷ctrl按下

private

void

reminderkeydown(object sender , keyroutedeventargs e)

if (_ctrl)

else

}private

bool _ctrl;

private

void

reminderkeyup(object sender , keyroutedeventargs e)

}

win10應用 UWP 使用MD5演算法

windows有自帶的演算法來計算md5 原本在wpf是 private string get md5 string str return strb.tostring tolower 進行md5,可是uwp沒有system.security.cryptography.md5cryptoservice...

Win10系列 UWP介面布局基礎5

2 編寫後台 訪問資源 xmlns xmlns x xmlns d xmlns mc mc ignorable d 執行後啟用樣式 fontsize 20 margin 169,345,0,378 接下來,在mainpage構造方法中引用鍵為 buttonstyle 的樣式資源為samplebutt...

Win10系列 UWP介面布局基礎5

2 編寫後台 訪問資源 xmlns xmlns x xmlns d xmlns mc mc ignorable d 執行後啟用樣式 fontsize 20 margin 169,345,0,378 接下來,在mainpage構造方法中引用鍵為 buttonstyle 的樣式資源為samplebutt...