버튼을 입력하고 다시 입력하여 새 비밀번호를 만들 수 있습니다.
두 암호가 같을 경우 암호를 나중에 사용할 수 있도록 휴대 전화의 어딘가에 저장해야합니다.기기에 비밀번호 저장
암호 안전을 무시할 수 있습니다.
가장 간단한 방법으로 장치에 암호를 저장하고 읽는 방법은 무엇입니까?
btnLogin.TouchUpInside += delegate {
if(password.Exists /*My Isolated storage or password file*/){
ReturnToView();
} else{
new UIAlertView("Password doesn't exists", "Create a new password, to log in", null, "Ok").Show();
}
};
것은 나는 이런 식으로 뭔가를 시도했다, 그러나 나는 암호가 .TXT
파일에 존재하는지 확인하는 방법을 모르겠어요.
void CreateUser(){
IsolatedStorageFile fileStorage = IsolatedStorageFile.GetUserStoreForApplication();
StreamWriter Writer = new StreamWriter(new IsolatedStorageFileStream("Password.txt", FileMode.OpenOrCreate, fileStorage));
btnCreateUser.TouchUpInside += delegate {
if(txtPassword.Text == txtRepeat.Text && txtPassword.Text.Length == 4){
GoBackToView(); //Login
Writer.WriteLine(txtPassword.Text);
Writer.Close();
} //here comes my else function, but that's not important.
};
}
그런 다음 암호는 .TXT
에 만들어야합니다. Login()
이라는 새로운 방법으로이 작업을 수행 할 것입니다. 내 로그인 버튼을 누르면
IsolatedStorageFile fileStorage = IsolatedStorageFile.GetUserStoreForApplication();
StreamReader Reader = null;
try
{
Reader = new StreamReader(new IsolatedStorageFileStream("Password.txt", FileMode.Open, fileStorage));
Reader.Close();
}
catch
{
MessageBox.Show("File it not created");
}
어딘가에 내 로그인 방법, 나는 암호가 생성되어 있다면 암호를 입력 한 경우 확인하고자합니다.
당신이 사용할 수 있으며 응용 프로그램 CoreData를 사용하는 경우 당신은 것을 사용뿐만 아니라 수 있습니다 . –
코드 샘플을 만들 수 있습니까? – Lobbe
공격은 없지만 스택 오버플로는 코드를 묻는 것이 아닙니다. 처음부터 직접 시도하십시오. 네가 어딘가에 붙어 있다면 우리가 도울 수있어. 내가 틀렸다고해도 응용 프로그램에 대한 로그인 시스템을 만들고 싶습니까? –