简体   繁体   中英

Hide application files from user Visual C#

After installing my application on a clients machine, How can I securely hide files used by my program from the user? Such as pdf's and video files. I am using C# and windows forms in Visual Studio 2013.

Another option would be using a ZIP Package (see MSDN ). You can store your files in the package with CompressionOption.SuperFast or even CompressionOption.NotCompressed to maximize performance. All your files will be located in that package, and you will be able to modify and save them back. Unfortunately, there is no option to encrypt nor password protect the package, and the user will be able to "open" your package in a ZIP tool (or even via Explorer), if he or she knows the file name and does understand that file extension doesn't matter.

As Matt commented, Embedded Resources is a way. Just remember that if you're currently navigating to your files (eg c:\\MyApp\\MyFile.pdf), you will not be able to do that anymore if you change these files to Embedded Resources.

Have a look at this Question .

You may also consider creating a Resource file (.resx) and adding your pdf's and videos into the resource file.

Managed to do it by converting all files to shock wave flash files and encrypting them. Then I could decrypt the files into a memory stream and display straight into a flash player.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM