누구든지 도와 줄 수 있습니까? 계속 오류가 발생했습니다 File beeing used by another process
. 여기 Username.omg 파일에 액세스 할 수 없습니다. 다른 프로세스에서 사용 중이기 때문에
string username = textBox1.Text;
string password = textBox2.Text;
string SecurityCode = textBox3.Text;
if(!Directory.Exists(path + "\\Login"))
Directory.CreateDirectory(path + "\\Login");
if (!File.Exists(path + "\\Login\\Username.omg" + "\\Login\\Password.omg" + "\\Login\\SecurityCode.omg"))
File.Create(path + "\\Login\\Username.omg");
File.Create(path + "\\Login\\Password.omg");
File.Create(path + "\\Login\\SecurityCode.omg");
File.AppendAllText(path + "\\Login\\Username.omg", username);
File.AppendAllText(path + "\\Login\\Password.omg", password);
File.AppendAllText(path + "\\Login\\SecurityCode.omg", SecurityCode);
MessageBox.Show("User Created: Welcome: " + username);
}
File.Create() 호출을 삭제하십시오. 대신 File.WriteAllText()를 사용하십시오. –