对于windows应用程序,在EXE中本地存储数据的最佳方法是什么?

时间:2022-02-22 16:57:53

I have a small windows application I wrote using Visual Studio 2010, CSharp, .NET 4.0 that does some scanning of remote pages using HTTP Requests, Pings, and DNS lookups.

我有一个使用Visual Studio 2010、CSharp、。net 4.0编写的小型windows应用程序,它使用HTTP请求、ping和DNS查找对远程页面进行扫描。

It then shows the results of the scan in tables (tabbed at the top) ordered by a column.

然后,它将扫描结果显示在按列排序的表中(表的顶部为选项卡)。

It's pretty simple but I want to add a "settings" panel or menu option so that the user can add certain configuration options such as -Timeout duration (HTTP calls) -Proxy details (port and IP) -Useragent -Email login details, port, email account type IMAP/POP3, password etc -Anything else

它非常简单,但我想添加一个“设置”面板或菜单选项,以便用户可以添加某些配置选项,如-Timeout duration (HTTP调用)-Proxy details(端口和IP) -Useragent -Email登录详细信息、端口、电子邮件帐户类型IMAP/POP3、密码等等

Therefore I want to add a small DB that is "ingrained" into the application and comes as part of the .EXE.

因此,我想在应用程序中添加一个小的DB,它是“根深蒂固的”,并且作为. exe的一部分。

I am used to writing client / server apps where the DB is on a remote server and the app somewhere else and using ADO connection strings to connect to this remote SQL Server which I then use management studio to look at the data.

我习惯于编写客户机/服务器应用程序,其中DB位于远程服务器上,而应用程序位于其他地方,并使用ADO连接字符串连接到这个远程SQL服务器,然后我使用管理studio查看数据。

I am not sure where to start with this type of small DB hooked into the app. Do I use SQlLite or SQL CE or some other kind of MS SQL DB.

我不知道从哪里开始,这类小型数据库连接到应用程序中。我是使用SQlLite还是SQL CE还是其他类型的MS SQL DB。

Do I have to write code inside the app to "create the DB, tables and populate them" and then get the data back out if they exist to show to the user so they can edit the details.

我是否必须在应用程序中编写代码来“创建DB、表并填充它们”,然后将数据取出(如果存在的话)以显示给用户,以便他们可以编辑细节。

Does the DB sit separately from the .EXE or is it part of the .EXE when I give it out to people as ideally I want it to be all part of the .EXE.

DB和。exe是分开的还是。exe的一部分当我把它分发给别人的时候我希望它都是。exe的一部分。

I am sure there are great tutorials online which I am looking through but I would just like to hear other peoples thoughts on the way to go and the best approach.

我肯定网上有很棒的教程,我正在浏览,但我只是想听听其他人对未来的想法和最好的方法。

Any links to guides or tutorials would be great if you have any.

如果你有任何指南或教程的链接,那就太好了。

Thanks in advance.

提前谢谢。

1 个解决方案

#1


5  

For small amounts of data, in particular if they are per-user, you can use the built-in Settings feature.

对于少量数据,特别是每个用户,可以使用内置的设置功能。

For larger amounts of data, in particular data you wish to query on, I suggest using an embedded database - SQL CE or SQLite are popular choices.

对于大量的数据,特别是您希望查询的数据,我建议使用嵌入式数据库——SQL CE或SQLite是常见的选择。

#1


5  

For small amounts of data, in particular if they are per-user, you can use the built-in Settings feature.

对于少量数据,特别是每个用户,可以使用内置的设置功能。

For larger amounts of data, in particular data you wish to query on, I suggest using an embedded database - SQL CE or SQLite are popular choices.

对于大量的数据,特别是您希望查询的数据,我建议使用嵌入式数据库——SQL CE或SQLite是常见的选择。