简体   繁体   English

隐藏用户Visual C#的应用程序文件

[英]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.

相关问题 如何在C#中向用户隐藏文件 - How to hide your files from user in C# 我的 C# win 表单应用程序在内部调用批处理脚本如何在 Visual Studio 中导出时对最终用户隐藏它? - My C# win form application internally calls a batch script how do I hide it from the end user while exporting in Visual Studio? 使用MVC应用程序C#中的API将文件/文件夹添加到Visual Studio Team Services(曾是TFS在线) - Add files/folder to Visual Studio Team Services (was TFS Online) using API from MVC application C# 将Oracle数据库中的单个用户数据检索到Visual Studio C#应用程序中 - Retrieve single user data from oracle database into visual studio C# application 保存应用程序特定的保存文件 C# Visual Studio - Saving application specific save files C# visual studio C#Visual Studio-使用文本文件实现用户身份验证 - C# Visual Studio - Implementing user authentication using text files 在c#应用程序中隐藏sqlcmd - Hide sqlcmd in c# application 如何从AC#WPF应用程序动态隐藏控制台窗口? - How to hide console window dynamically from a c# wpf application? C#Windows 8.1应用程序对用户隐藏设置和数据 - C# Windows 8.1 app hide settings and data from user 用于编辑 C# 应用程序配置文件的通用用户界面 - Generic user interface for editing C# application configuration files
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM