欢迎访问 生活随笔!

生活随笔

当前位置: 首页 >

Winform中简单使用MD5加密用户登录密码

发布时间:2025/3/19 36 豆豆
生活随笔 收集整理的这篇文章主要介绍了 Winform中简单使用MD5加密用户登录密码 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

场景

MD5加密登录密码效果

 

注:

博客主页:
https://blog.csdn.net/badao_liumang_qizhi
关注公众号
霸道的程序猿
获取编程相关电子书、教程推送与免费下载。

实现

新建Winform程序并添加System.Web引用

 

然后新建一个登录页面,并设计登录页面布局如下

 

然后进入其代码修改为

using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms;namespace MD5EnPWD {public partial class Form1 : Form{public Form1(){InitializeComponent();}private void textBox2_TextChanged(object sender, EventArgs e){textBox3.Text = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(textBox2.Text, "MD5");}} }

 

与50位技术专家面对面20年技术见证,附赠技术全景图

总结

以上是生活随笔为你收集整理的Winform中简单使用MD5加密用户登录密码的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。