[英]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.
例如pdf和视频文件。 I am using C# and windows forms in Visual Studio 2013.
我在Visual Studio 2013中使用C#和Windows窗体。
Another option would be using a ZIP Package
(see MSDN ). 另一种选择是使用ZIP
Package
(请参阅MSDN )。 You can store your files in the package with CompressionOption.SuperFast
or even CompressionOption.NotCompressed
to maximize performance. 您可以使用
CompressionOption.SuperFast
甚至CompressionOption.NotCompressed
将文件存储在包中,以最大限度地提高性能。 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.
不幸的是,没有加密或密码保护程序包的选项,如果用户知道文件名并且确实了解该文件,则用户将可以使用ZIP工具(甚至通过资源管理器)“打开”您的程序包。扩展无关紧要。
As Matt commented, Embedded Resources is a way. 正如Matt所说,嵌入式资源是一种方法。 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.
只要记住,如果您当前正在导航到文件(例如c:\\ MyApp \\ MyFile.pdf),那么如果将这些文件更改为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. 您也可以考虑创建资源文件(.resx),并将pdf和视频添加到资源文件中。
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.
然后,我可以将文件解密到内存流中,并直接显示在Flash Player中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.