을 찾을 것 같다하여 FileStream은이 코드가 unexisting 파일을
public static string GetUserEmail()
{
string path = Application.StartupPath + "\\mail.txt";
MessageBox.Show(path);
string adres = String.Empty;
if (File.Exists(path))
{
using (StreamReader sr = new StreamReader(path))
{
adres = sr.ReadLine();
}
}
else
{
using (FileStream fs = File.Create(path))
{
using (StreamReader sr = new StreamReader(path))
{
adres = sr.ReadLine();
}
}
}
MessageBox.Show(adres);
return adres;
}
내가 MessageBox.Show와 ApplicationPath 인자를() 검사를; 보시다시피, 파일을 삭제하고, 응용 프로그램을 다시 시작하고, 여전히 이전 줄을 읽습니다. 앱을 다시 설치 제거하고 파일을 찾은 다음 처음 설치시 입력 한 것과 같은 줄을 읽은 것 같습니다. 나는 윈도우, 전체 C 드라이브를 검색했다. mail.txt가 없다. 그리고 여전히 mail.txt를 찾고 라인을 읽는다. (사용자를 식별하는 데 사용되는 전자 메일 주소)
무엇이 될 수 있는가? 외계인?