Prevent access to a file (vc++, vc#)

Prevent access to a file (vc++, vc#)

am 05.10.2006 03:52:53 von SoxFan44

Hi,
I was wondering if there way any way that I could write a program that would
run in the background and prevent access to a specific file. I can't use
Windows permissions. Thanks for any advice!

Re: Prevent access to a file (vc++, vc#)

am 05.10.2006 04:27:14 von Adam Ruth

SoxFan44 wrote:
> Hi,
> I was wondering if there way any way that I could write a program that would
> run in the background and prevent access to a specific file. I can't use
> Windows permissions. Thanks for any advice!
>
>

You could, conceivably, open the file with CreateFile and specify 0 for
the dwShareMode parameter which would not allow anyone to read or write
the file.

Adam Ruth