default.aspx.cs

来自「这是asp.net^和Visual C++Sharp编写的串并口通讯的书籍 源代」· CS 代码 · 共 40 行

CS
40
字号
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

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 strMd5 = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(txtPwd.Text, "MD5");
       string strSHA = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(txtPwd.Text, "SHA1");
        string strPass = "加密前密码为:" + txtPwd.Text + "\\n";
        strPass += "MD5算法加密密码为:" +strMd5 +"\\n";
        strPass += "SHA1算法加密密码为:" + strSHA;


       Response.Write("<script>alert('"+strPass+"');</script>");
       
    
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        txtPwd.Text = "";
        txtLoginName.Text = "";
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?