Good day, is there any option how to create a box, which cannot be seen from Windows? I would like to insert some files into this box. These files should be accessible only through my application, not from Windows. Thank you in advance.
-
It can be folder, but this folder should not be accessible from Windows, but only from application. Is that possible? – cotablise Feb 12 '12 at 12:16
-
1You can't create a 'box'. it'll have to be a folder. Also, there is no way of guaranteeing Windows won't access the files - short of uninstalling windows. – Ayush Feb 12 '12 at 12:19
-
hmmm. I wanted to create folder which cannot be accessible from Windows directly. User should to use my application to reach these files. Too bad that I cannot do it. Thanks for your help – cotablise Feb 12 '12 at 12:27
-
2What is the reason for doing this? Why are you trying to hide the files? – svick Feb 12 '12 at 13:22
4 Answers
How many files and how do you need to access them? If they are only for reading and you don't have too many, you always have the option to store them as a resource in your project. Have a look at this link on MSDN on how to store various file types directly inside your assembly.
NOTE: If you are planning on storing passwords or security-sensitive data, you shouldn't use this approach.
Another alternative would be to store you files inside a database. If you were to use something such as SQLite (here is the .Net data provider), Windows would have access to the database file, but not to the files contained within the database (which could be encrypted). Depending on your data, you'd have to store the file information as a binary large object (blob). See here for an example of how to do this.

- 1
- 1

- 21,731
- 12
- 83
- 117
It depends on the layer of abstraction you want. All files created by an application are at some level accessible by windows, however, you can mask the content of these files (i.e. encrypt them).
Generally speaking, you could still store the files in a folder, and apply encryption. Here's the msdn article on the point. The other issue is where do you store the key used for encryption.
A simple solution is to hard-code the key in some variable. However, if the assembly is decompiled, the key will become apparent. On the other hand, if you want the user that created the files to begin with, to be the only one to access the files, then you can use the Data Protection API.

- 30,469
- 8
- 53
- 60
If your question is how to the hide the box then you can set the "Visible" attribute to false no matter what control you are using for this "box".

- 1,590
- 8
- 13
-
Problem is that I don't know how to create box or something like that, where I can insert files. I dont want only to change attribute of windows folder. I want to create something like folder, but this folder should not be accessible from Windows, but only from application. Is that possible? – cotablise Feb 12 '12 at 12:15
if your box does not include a lot of files or not large file, you can try save it in a compress file like .zip and add a password for it. also add the hidden attribute on that box.

- 1,099
- 2
- 6
- 6
-
But this ZIP will be accessible from Windows. I am trying to find out, whether I can create something what will not be accessible from Windows directly. User has to use my application to reach these files. – cotablise Feb 12 '12 at 12:24