[英]Access to the path “somepath” is denied."
当我在C#控制台应用程序中执行此代码时, using
行将引发"Access to the path "somepath" is denied"
访问。
这是我的代码。
static public PdfDocument Open(string PdfPath)
{
using (var fileStream = new FileStream(PdfPath, FileMode.Open, FileAccess.Read))
{
int len = (int)fileStream.Length;
Byte[] fileArray = new Byte[len];
fileStream.Read(fileArray, 0, len);
return Open(fileArray);
}
}
怎么了 任何想法? 顺便说一下,我以系统管理员身份登录,并且在给定文件夹中拥有完全控制权。
也许文件是由另一个进程以独占写入模式打开的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.