C# - 不要让用户复制文件或查看其内容 [英] C# - Don't let the user to copy a file or see its content

查看:96
本文介绍了C# - 不要让用户复制文件或查看其内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

在提出问题之前,我应该解释一下情况。我正在为一个特殊的硬件设备编写一些脚本(用非常低级的脚本语言)。公司有一个程序可以读取这些脚本,并向设备发送一些命令。
我将把这些脚本提供给客户。但他们不应该看到这些脚本的内容或复制它们。因此,我应该编写一个程序,将所有这些脚本打包在一个可执行文件中,当客户运行此可执行文件时,它应该将
脚本复制到另一个软件从该文件夹中读取脚本的特殊文件夹。换句话说,只是一个软件应该有权打开我的脚本并阅读它们而不是客户。有没有人有任何想法?

Before asking my question, I should explain what the situation is. I'm writing some scripts(in a very low level scripting language) for a special hardware device. There is a program from a company that reads these scripts, and send some commands to the device. I'm going to give these scripts to customers. But they shouldn't be able to see content of these scripts or copy them. So, I should write a program that pack all these scripts in a executable file and when customer runs this executable, it should copy the scripts to a special folder that the other software reads the scripts from that folder. It the other word, just a software should has permission to open my scripts and read them not customers. Does anyone has any idea?

谢谢

推荐答案

生成文件二进制格式,使其人性化程度较低。

Generate the file in Binary format which make it less human readable.

但最好的选择是对应用程序生成的文件使用加密(CryptoStream)&将加密详细信息通知给将解密您生成的文件的其他软件。从中提取内容。

But the best option is to use some encryption (CryptoStream) on the file generated by your application & inform the encryption details to the other software which will decrypt the file you generated & extract the contents from it.


这篇关于C# - 不要让用户复制文件或查看其内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆