美文网首页
MD5加密网站(c#)

MD5加密网站(c#)

作者: xuanxi | 来源:发表于2017-11-03 17:01 被阅读0次

    一、文件---->新建----->网站----->空网站

    右击website2---->添加新项------>web窗体--------->default.aspx

    二、设计页面(TextBox1;Button1;Label1)

    将button1--->属性---->Text:改为MD5加密

    三、写代码

    在头部加上命名空间using System.Web.Security;

    【default.aspx.cs】

    附源码:

    using System;

    using System.Collections.Generic;

    using System.Linq;

    using System.Web;

    using System.Web.UI;

    using System.Web.UI.WebControls;

    using System.Web.Security;

    public partial class _Default : System.Web.UI.Page

    {

    protected void Page_Load(object sender, EventArgs e)

    {

    }

    protected void Button1_Click(object sender, EventArgs e)

    {

    string strtxt = TextBox1.Text;

    Label1.Text = FormsAuthentication.HashPasswordForStoringInConfigFile(TextBox1.Text, "MD5");

    }

    }

    相关文章

      网友评论

          本文标题:MD5加密网站(c#)

          本文链接:https://www.haomeiwen.com/subject/pzieuxtx.html