문제

Possible Duplicate:
Read file which is in use?

I am trying to access a file that is already in use in Windows 7. I have tried all the suggestions I could find on this site and other but no success yet.

What I have tried:

FileStream fs = new FileStream(iFile, FileMode.Open, FileAccess.Read, FileShare.Read);
FileStream fs = new FileStream(iFile, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
FileStream fs = new FileStream(iFile, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite);
FileStream fs = new FileStream(iFile, FileMode.Open, FileAccess.ReadWrite, FileShare.Read);

Always the same error

The process cannot access the file 'fileinuse' because it is being used by another process.

I am open to any work arounds to this problem.

Thanks in advance for any help!

도움이 되었습니까?

해결책

If another process opens the file in "exclusive mode" then you cannot get access to the file.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top