public MyLoginControl()
{
InitializeComponent();
}
public string UserName
{
get { return this.user.Text; }
}
public string PassWord
{
get { return this.jiami(this.pass.Password); }
}
private string jiami(string pass){
if(string.IsNullOrEmpty(pass)){
return string.Empty;
}
System.Security.Cryptography.HMACSHA1 hm = new System.Security.Cryptography.HMACSHA1();
byte[] buffer = System.Text.Encoding.UTF8.GetBytes(pass);
byte[] result = hm.ComputeHash(buffer);
string resStr = "";
foreach(byte b in result){
resStr += b.ToString("x");
}
return resStr;
}
private void user_TextChanged(object sender, TextChangedEventArgs e)
{
}
private void Button_Click(object sender, RoutedEventArgs e)
{
string temp;
temp = "用戶名" + login.user + "\n密碼" + login.PassWord;
this.text.Text = temp;
}
Windows Phone 引導頁和密碼加密
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.