VS调试出现某路径拒绝访问的问题解析

When we use Visual Studio to develop our program to access a file, we often encounter a common issue, that is"UnauthorizedAccessException". For this issue, I think there are some possible reasons:
1. The file is read-only  -- you have to modify the property of the file
2. Insufficient permission of the account  -- you maybe run the vs with administrator accouont
3. Wrong file path -- this is what I need to remember specially
e.g
FileStream fs = new FileStream(@"F:\GWork\WorkSpace\Serializable\demo.txt",FileMode.Create);
the code above, if you missing the "demo.txt" which in red, you will meet the issue which mentioned above.

转载于:https://www.cnblogs.com/gavin-king/p/4907458.html

你可能感兴趣的:(VS调试出现某路径拒绝访问的问题解析)