c# - Read already opened file -


is there way read binary data read-only file? have excel worksheet, might opened in excel want open read purposes only.

i tried way:

using (filestream filestream = file.open(filepath, filemode.open, fileaccess.read, fileshare.read)) 

and getting

the process cannot access file 'something.xlsx' because being used process.

is there way achieve that?

change argument:

 fileshare.read 

to this:

 fileshare.readwrite 

you attempting deny write access file, causing issue excel has open writing.


Comments

Popular posts from this blog

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -