0
非常に新しい#になってしまい、ファイルに書き込もうとしていますが、このエラーが発生します。助言がありますか?ファイルに書き込むときにunauthorisedAccessExceptionが発生する
System.UnauthorizedAccessException: 'Access to the path 'C:\Users\tom\Desktop\theBeast\theBeast\bin\Debug' is denied.'
my code:
string hashedValue = Hash(hashed);
string Path = @"\Users\tom\Desktop\theBeast\theBeast\bin\Debug";
using (System.IO.StreamWriter Account = new System.IO.StreamWriter(Path, true))
{
Account.WriteLine(Username + "," + hashedValue + ",User");
System.Windows.Forms.MessageBox.Show("Account Successfully Created");
}
あなたのコードを投稿することをお勧めします。 –
そのディレクトリに書き込む権限がありますか?新しいファイルを作成しようとすると、あなたが拒否されたとか、管理者権限が必要だと言われますか? – astidham2003
Path変数にフォルダではなくファイルへのパスが含まれていると思います。 @ "... \ Debug \ filename.txt" – Artem