none
hide my files RRS feed

  • Question

  • Hi I am writing a program but I need to make my files unreadable and unfindable for users how can I do it? I am a beginner my program in on C# language
    Monday, January 7, 2013 8:00 AM

Answers

  • Hi Mohanmad,

    Welcome to the MSDN Forum.

    How about this: http://msdn.microsoft.com/en-us/library/3ak841sy.aspx 

    For desktop apps, isolated storage is a data storage mechanism that provides isolation and safety by defining standardized ways of associating code with saved data. Standardization provides other benefits as well. Administrators can use tools designed to manipulate isolated storage to configure file storage space, set security policies, and delete unused data. With isolated storage, your code no longer needs unique paths to specify safe locations in the file system, and data is protected from other applications that only have isolated storage access. Hard-coded information that indicates where an application's storage area is located is unnecessary.

    And you can find the how-to articles on the left side of that webpage.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, January 8, 2013 7:43 AM
    Moderator

All replies

  • Hi,
    after you finish programming you are going to provide assembliy files to the end user, not the source code.
    Why are you worrying about hiding your source codes from user,it will not be visible to end user.

    One good question is equivalent to ten best answers.

    Monday, January 7, 2013 8:16 AM
  • Yeah nice Idea & nice sentence But my files are mo important than my program cause my program is not very complex and it's so easy to write it but my files are an important archive of data that I don't want to be copied at all
    Monday, January 7, 2013 8:53 AM
  • Maybe you can encrypt your files? Even if someone copies your files he will not know what is inside. There are many article about encrypting files and strings.

    Monday, January 7, 2013 9:05 AM
  • Hi Mohanmad,

    Welcome to the MSDN Forum.

    How about this: http://msdn.microsoft.com/en-us/library/3ak841sy.aspx 

    For desktop apps, isolated storage is a data storage mechanism that provides isolation and safety by defining standardized ways of associating code with saved data. Standardization provides other benefits as well. Administrators can use tools designed to manipulate isolated storage to configure file storage space, set security policies, and delete unused data. With isolated storage, your code no longer needs unique paths to specify safe locations in the file system, and data is protected from other applications that only have isolated storage access. Hard-coded information that indicates where an application's storage area is located is unnecessary.

    And you can find the how-to articles on the left side of that webpage.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, January 8, 2013 7:43 AM
    Moderator
  • I am not sure if you intend to hide your application generated/used file. If so below code snippet will make sure the file is hidden, and thus is not included in an ordinary directory listing.

    File.SetAttributes("pathToFile",FileAttributes.Hidden)

    Apart from this You have many options

    Option-One: If your archive file are static in nature and you are not modifying these file at runtime than you can embed those files as resource to Assembly/DLL so that it will be compiled as created a single DLL/EXE. Refer: http://msdn.microsoft.com/en-us/library/7k989cfy(v=vs.80).aspx

    Option Two: As your issue lie on sensitive data , you can concentrate on securing the content of file instead of securing the file i.e through using Hashing or Encrypting. Refer: http://www.codeproject.com/Articles/26085/File-Encryption-and-Decryption-in-C

    Option Three: You can create a Password protected .Zip/.Rar through program and use it. Refer: http://www.c-sharpcorner.com/uploadfile/neill1212/password-encrypted-zip-files-in-C-Sharp/

    Option Four: Use Build-in OS features to encrypt your Application Program folder like http://support.microsoft.com/kb/308989

    If you are looking for a simple solution than File.SetAttribute is fine else go with option two.

    Mike's suggestion on IsolatedStorage looks promissing too.


    Lingaraj Mishra




    Tuesday, January 8, 2013 11:58 AM