如何使文本文件只读且不能复制 [英] How to make a text file read only and can't copy

查看:187
本文介绍了如何使文本文件只读且不能复制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我想在c#.net中开发一个只读的文本文件
该文件的另一个功能是,如果有人要复制该文件,则消息闪烁,表示您无法复制所选文件.我在网上搜索了太多内容,但找不到任何解决方案.请帮助我如何制作这样的文件

Hello All,
i want to develop a text file in c#.net that is read only
The another feature of that file is that if some body wants to copy it,message blinks that says u cant copy the selected file.I have searched too much over net but i cant get any solution.please help me how to make such a file

推荐答案

如果您允许某人打开文本文件并说您不允许复制文件",那么这样做有什么好处吗?您想要在这里实现什么-不允许任何人复制内容,而只是阅读?

为什么我要这样,如果您允许打开一个文本文件,那么您就允许复制内容",因此所有不允许复制文件"的努力都是徒劳的.

我怀疑您的逻辑或要求中存在一些缺陷.选择正确的控件/流.
If you allow someone to open a text file and lets say you don''t allow to copy the ''file'', does that do any good? What were you trying to achieve here - not allowing anyone to copy content, just read?

Why I ask so, if you allow opening a text file then you are allowing to copy the ''content'' and thus all your effort to not allow copying the ''file'' goes into vain.

I doubt, there is some flaw in your logic or requirement. Pick correct control/flow.


我认为您无法制作受复制保护的文件.
如果您不希望别人看到文件中的内容,则应对其进行加密.
I don''t think you can make a copy protected file.
If you don''t want people to see what''s inside your file you should encrypt it.


amit2620写道:
amit2620 wrote:

我想在C#.net中开发一个只读的文本文件

i want to develop a text file in C#.net that is read only


假设您正在创建一个文本文件.有关更改文件属性的示例,请参见下面的MSDN页面:"File.SetAttributes方法" [^ ].


Assuming you''re creating a text file. See the following MSDN page for an example on changing file attributes:"File.SetAttributes Method"[^].

amit2620写道:
amit2620 wrote:

该文件的另一个功能是,如果有人想要复制该文件,则消息闪烁,表示您无法复制所选文件.我在网上搜索了太多内容,但找不到任何解决方案.请帮助我如何制作这样的文件

The another feature of that file is that if some body wants to copy it,message blinks that says u cant copy the selected file.I have searched too much over net but i cant get any solution.please help me how to make such a file


据我所知,您不能这样做(如果要隐藏文件的内容,可以对文件进行加密).


As far as I know, you cannot do that (you may encrypt the file, if you want to hide it''s content).


这篇关于如何使文本文件只读且不能复制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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