MD5加密网站(c#)

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

右击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");

}

}

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Correctness AdapterViewChildren Summary: AdapterViews can...
    MarcusMa阅读 8,912评论 0 6
  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 134,908评论 18 139
  • 转载自:.net 页面传参方式总结 ASP.NET为我们提供了三种方式,一种是可以通过用QueryString来传...
    BigbyLong阅读 284评论 0 1
  • 概述 在多数移动应用中任何时候都只能有一个应用程序处于活跃状态,如果其他应用此刻发生了一些用户感兴趣的那么通过通知...
    莫离_焱阅读 6,550评论 1 8
  • 是秋 桂花飘香 是雨 叮当作响 是你 洒满阳光
    林沐夏阅读 68评论 0 1