报错场景
System.IO.File.WriteAllText(destPath, text);
解决方案
An UnauthorizedAccessException means one of 4 things:
1. The caller does not have the required permission.
2. The file is an executable file that is in use.
3. Path is a directory.
4. Path specified a read-only file.
我的问题是第三点,传入的“destPath”参数,是个目录,无法写入~