<%@ Page Language="C#" autoeventwireup="true" %> <script runat="server"> void Cancel_Click(object sender, EventArgs e) { userName.Text = ""; password.Text = ""; repeatPassword.Text = ""; result.Text = ""; } void HashPassword_Click(object sender, EventArgs e) { if (Page.IsValid) { string hashMethod = ""; if (sha1.Checked) { hashMethod = "SHA1"; } else { hashMethod = "MD5"; } string hashedPassword = FormsAuthentication.HashPasswordForStoringInConfigFile(password.Text, hashMethod); result.Text="<credentials passwordFormat=/"" + hashMethod +"/">
" + " <user name=/"" + userName.Text + "/" password=/"" + hashedPassword + "/">
" + "</credentials>"; } else { result.Text = "There was an error on the page."; } } </script>
" + " <user name=/"" + userName.Text + "/" password=/"" + hashedPassword + "/">
" + "</credentials>"; } else { result.Text = "There was an error on the page."; } } </script>