Hash password : FormsAuthentication « Login Security « ASP.Net






Hash password


<%@ Page Language="VB" %>
<%@ Import Namespace="System.Web.Security" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Password Hashing Page</title>
<meta name="GENERATOR" content="Microsoft Visual Studio.NET 7.0">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
<script runat="server">
   Sub Hash_Click(Sender As Object, e As EventArgs)
      HashOut.Text = FormsAuthentication.HashPasswordForStoringInConfigFile(Password.Text, HashType.SelectedItem.Value)
   End Sub
</script>
</head>
<body>
   <form runat="server">
      <table border="0">
         <tr>
            <td>Hash Type: </td>
            <td>
               <asp:dropdownlist id="HashType" runat="server">
                  <asp:listitem>MD5</asp:listitem>
                  <asp:listitem>SHA1</asp:listitem>
               </asp:dropdownlist>
            </td>
         </tr>
         <tr>
            <td>Password: </td>
            <td><asp:textbox id="Password" textmode="Password" runat="server"/></td>
         </tr>
         <tr>
            <td colspan="2"><asp:button text="Hash" onclick="Hash_Click" runat="server"/></td>
         </tr>
      </table>
      <asp:label id="HashOut" runat="server"/>
   </form>
</body>
</html>

 








Related examples in the same category

1.FormsAuthentication.Authenticate (C#)
2.FormsAuthentication.RedirectFromLoginPage (VB)
3.Checking credentials in SQL Server (VB)
4.Checking credentials in SQL Server (C#)
5.assigning a name to the user accessing next pages
6.FormsAuthentication.SignOut()
7.Save user account to an XML file