반응형
로그인 아이디와 같은 간단한 사용자 정보는 레지스트리에 등록하여 사용가능
프로그램이 업데이트 되어도 사용자 정보는 그대로 사용할 경우 유용
private const string c_RegistryKey = @"Software\Ungs"; // 상위 경로는 HKEY_CURRENT_USER 로 자동 설정
// 레지스트리 저장시
RegistryKey regKey = Registry.CurrentUser.CreateSubKey(c_RegistryKey)
regKey.SetValue("UserId", "입력데이터");
// 레지스트리 출력
RegistryKey regKey = Registry.CurrentUser.OpenSubKey(c_RegistryKey);
if (regKey != null){
string text = (string)regKey.GetValue("UserId");
regKey.Close();
}
반응형
'C#' 카테고리의 다른 글
[C#] CheckForIllegalCrossThreadCalls 크로스스레드 (0) | 2021.02.16 |
---|---|
[C#] TopMost 폼 여러개일 경우 가장 위로 설정 (0) | 2021.02.16 |
[C#] Form 호출 (0) | 2021.02.16 |
[C#] Invoke, InvokeRequired (0) | 2021.02.16 |
[C#] DB연결 SQLConnection (0) | 2021.02.16 |