限制vb.net中应用程序文件夹中的文件 [英] Restrict file in application folder in vb.net

查看:55
本文介绍了限制vb.net中应用程序文件夹中的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!我的应用程序上有一个表单,允许用户向数据库添加连接.我正在将连接字符串写在XML文件上,我的问题是如何向XML文件添加限制以防止编辑和删除文件?我在想是否可以使用vb.net中的代码在文件本身上增加安全性?尽管XML文件的内容已加密,但是我想添加其他安全功能,以避免删除/编辑文件.我希望有人可以帮助我.预先感谢大家.

Good day guys! I have a form on my application that allows the user to add connection to the database. I am writing the connection string on an XML file, my question is how can I add a restriction to the XML file to prevent editing and deletion of the file? I was thinking if it is possible to add security on the file itself using codes in vb.net? Although the content of the XML file is encrypted, yet I want to add additional security features to avoid deletion/editing of the file. I hope someone can help me with this. Thanks in advance guys.

推荐答案

您不能.无论如何,如果是文件,我可以将其删除.您可以将默认值存储在您的应用程序中,如果将其删除则将其替换,但是您不能阻止其他人删除或编辑它.如果您不希望对其进行编辑,为什么将其完全存储在应用程序之外?
You can''t. No matter what, if it''s a file, I can delete it. You could store a default inside your app, and replace it if it''s deleted, but you can''t stop people deleting it or editing it. If you don''t want it edited, why is it stored outside the app at all ?


这篇关于限制vb.net中应用程序文件夹中的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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