<script language="C#" runat=server>
void Button_Click(Object sender , EventArgs e)
{
string strHashValue;
strHashValue = FormsAuthentication.HashPasswordForStoringInConfigFile( txtPassword.Text, lstAlgorithm.SelectedItem.Text );
lblHash.Text = strHashValue;
}
</Script>
<html>
<head><title>ComputeHash.Aspx</title></head>
<body>
<form Runat="Server">
<h2>Compute Hash Value:</h2>
<b>Password:</b>
<br>
<asp:TextBox
ID="txtPassword"
Runat="Server" />
<p>
<b>Algorithm:</b>
<br>
<asp:ListBox
ID="lstAlgorithm"
Runat="Server">
<asp:ListItem Text="SHA1" />
<asp:ListItem Text="MD5" />
</asp:ListBox>
<p>
<asp:Button
Text="Compute!"
OnClick="Button_Click"
Runat="Server" />
<hr>
Hash Value:
<br>
<asp:Label
ID="lblHash"
Runat="Server" />
</form>
</body>
</html>