0
Can't get access to create a file
https://code.sololearn.com/c6VYX71LF3bU/?ref=app Here is the code in windows forms
11 Answers
+ 3
You don't write file name in the end of path. For example your path must be "E:\test.txt"
+ 2
1) try start program as admin
2) try use StreamWriter instead File.Create
Exceptions
UnauthorizedAccessException
The caller does not have the required permission.
-or-
path specified a file that is read-only.
-or-
path specified a file that is hidden.
+ 2
I test it, and all working. Without name of file - UnauthorizedAccessException
+ 2
And one more, you must use file.close() after operation.
+ 1
I think, it is some trouble with OS , authorization, but tomorrow i test it.
are folder in which you try create file is not system folder?
+ 1
Dead Lord i'm glad, that's your problem are solved đ
P.s. thanks for marking as best answer!
+ 1
id001x thank you for the help! Really useful
0
Your program is not running properly. Please fix that and then Check.
0
id001x same sh** if I use streamWriter. System.UnauthorizedAccessException
0
id001x no. It's just E:/ or eve when I choose some folder from there, same prblm
0
id001x is that really that simple!? :D no way!) I'll test it this evening :)