locked
Secure a file in a target folder RRS feed

  • Question

  • Hi,

    In the framwork 3.5 vs 2008 C#, I can do the System.IO.File.Copy documents(e.g., PDF, doc, docx, pdf, xls, ...) to a target folder.
    But now come the question, is it possbible to secure those documents from the VS 2008 C# so that whenever a client wants to read a document, then he must provide a correct password to read it, otherwise, he can never read that document?  Also, the client can never modify that document as well.
    Thanks for help.

    Jason

    Monday, October 6, 2014 7:19 AM

Answers

  • .Net can NOT protect the document from modification. If it is a word document, then the way to secure it is by using word tools. But these can be hacked (like everything else).

    The same applies to PDF docs. They should be protected with PDF tools, and can be also hacked.

    The same applies to all knds of docs. :-(

     

    Noam B.


    Do not Forget to Vote as Answer/Helpful, please. It encourages us to help you...

    Monday, October 6, 2014 10:43 AM
  • Hi Jason,

    In order to protect your file. You can consider using encrypt and decrypt the file.

    File Encryption and Decryption in C#

    How to encrypt and decrypt a file by using Visual C#

    Have a nice day!

    Kristin


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, October 7, 2014 6:34 AM

All replies

  • You can provide a ShowDialog with a password before proceeding and set File.AccessMode = read.
    Monday, October 6, 2014 7:50 AM
  • Please refer the link

    http://www.codeproject.com/Articles/20880/Folder-protection-for-Windows-using-Csharp-and-con

    Monday, October 6, 2014 7:52 AM
  • .Net can NOT protect the document from modification. If it is a word document, then the way to secure it is by using word tools. But these can be hacked (like everything else).

    The same applies to PDF docs. They should be protected with PDF tools, and can be also hacked.

    The same applies to all knds of docs. :-(

     

    Noam B.


    Do not Forget to Vote as Answer/Helpful, please. It encourages us to help you...

    Monday, October 6, 2014 10:43 AM
  • Hi Jason,

    In order to protect your file. You can consider using encrypt and decrypt the file.

    File Encryption and Decryption in C#

    How to encrypt and decrypt a file by using Visual C#

    Have a nice day!

    Kristin


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, October 7, 2014 6:34 AM