将文件打包到程序中 [英] Package a file within program

查看:64
本文介绍了将文件打包到程序中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用C#winform将Excel内容导入数据集.
现在,我想隐藏Excel文件,并且不允许用户对其进行编辑,是否有方法或选项可以将文件打包到Winform程序中.

我选择Excel作为数据库的原因是可以直接轻松地对其进行编辑.另外,它不是唯一的选择,我只需要在Winform里面打包一个小数据库,这是为了禁止用户编辑甚至查看它.

I use C# winform, to import a Excel content to a dataset.
Now I want to hide the Excel file and don''t allow user to edit it, is there a method or option to package the file to winform program.

The reason i choose Excel as Database is could edit it directly and easy. Also itn''t the only choice, i just need package a small database to winform inside, this is aim to prohibit user to edit even to see it.

How to achieve this?

推荐答案

任何文件都可以直接打包在程序集中,但据我所知这些文件是只读的.
建议您将数据存储在单独的文件中,并使用加密来保护数据以免直接读取/写入.
Any file can be packed directly in the assembly, but as far as I know such files are read-only.

I suggest storing your data in a separate file and use encryption to protect your data from direct reading/writing.


这篇关于将文件打包到程序中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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