When i execute this code in my C# console application, it throws "Access to the path "somepath" is denied(in the below bold highlighted line)."
This is my code.
static public PdfDocument Open(string PdfPath)
{
**using (FileStream fileStream = new FileStream(PdfPath, FileMode.Open, FileAccess.Read))**
{
int len = (int)fileStream.Length;
Byte[] fileArray = new Byte[len];
fileStream.Read(fileArray, 0, len);
fileStream.Close();
return Open(fileArray);
}
}
What is going wrong. Any thought? By the way I logged in as system admin and I have full control in the given folder.