被编辑防止文件 [英] Prevent file from being edit

查看:106
本文介绍了被编辑防止文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是防止一个文本文件(例如XML)从用户获取编辑最聪明的方式?
我需要确保我在其中存储桌面应用程序的用户名和有特权的文件不能被简单地编辑。

What's the smartest way to prevent a textfile (e.g. xml) from getting edit by a user? I need to make sure that the file in which I store the usernames and there privileges for the desktop application can't be simply edited.

也许我可以生成该文件的证书和桌面应用程序的检查呢?

Maybe I can generate a certificate of the file and the desktop applications checks this?

我使用C#中的WinForms应用程序。

I'm using C# in a WinForms app.

推荐答案

您可以使用文件系统权限来防止编辑。

You could use File system permissions to prevent editing.

您可以使用加密来使编辑困难

You could use encryption to make editing difficult

您可以得到该文件来检测编辑的哈希值。

You could get a hash value for the file to detect editing.

我想加密的文件,然后解密这将是最容易的。尽管用户可能仍然能够如果他们足够聪明来读取文件的内容。例如从存储器读取纯文本

I think encrypting the file, then decrypting it will be easiest. Though users might still be able to read the contents of the file if they're smart enough. e.g. reading the plain-text from memory

这篇关于被编辑防止文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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