winform中进行md5加密|Winform中进行MD5加密的实例

时间:2021-06-10  来源:WinForm  阅读:

Winform,c#进行MD5加密直接上步骤:

1. 添加引用

2. 在.NET选项卡中找到“System.Web”

3. 选中之后,点击“确定”即可,此时会在解决方案中看到刚才添加的引用

4. 引用名空间:using System.Web.Security;

Click事件中的代码如下:

还有一种方法:

引用

 

 代码如下 using System.Security.Cryptography;
using System.Text;

 

具体代码如下(写在按钮的Click事件里):

 代码如下 byte[] result = Encoding.Default.GetBytes(this.tbPass.Text.Trim()); //tbPass为输入密码的文本框 MD5 md5 =newMD5CryptoServiceProvider(); byte[] output = md5.ComputeHash(result); this.tbMd5pass.Text = BitConverter.ToString(output).Replace("-","");//tbMd5pass为输出加密文本的文本框

winform中进行md5加密|Winform中进行MD5加密的实例

http://m.bbyears.com/asp/122952.html

推荐访问:
相关阅读 猜你喜欢
本类排行 本类最新