c# - Deny access to documents outside application -
i developing application keeps document repository , provide searching it. want prevent users view/add/modify/delete documents outside application. currently, storing documents in normal folder structure in windows, accessible authorized windows user. seeking methodology using which, can ensure that, none other application can access documents.
is there library or technique available, using can hide files windows user, application can use in normal way?
if have save documents in windows , want restrict users try saving them in encrypted form possibly password. if has access it, becomes useless him. like should work encryption
using (var filestream = file.openwrite(thefilename)) using (var memorystream = new memorystream()) { // serialize memory instead of file var formatter = new binaryformatter(); formatter.serialize(memorystream, customer); // resets memory stream position following read operation memorystream.seek(0, seekorigin.begin); // bytes var bytes = new byte[memorystream.length]; memorystream.read(bytes, 0, (int)memorystream.length); var encryptedbytes = yourcrypto.encrypt(bytes); filestream.write(encryptedbytes, 0, encryptedbytes.length); }
and can use library password protection , zipping
Comments
Post a Comment