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.