如何在windows应用程序中保存各个字段的参数 [英] How to save parameters of various fields in windows application
本文介绍了如何在windows应用程序中保存各个字段的参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
有人可以告诉我如何在不使用数据库的情况下从本地目录或PC的本地磁盘保存和检索数据。这是更好的方法..?由于客户端系统没有数据库所以我需要使用替代方法来保存数据并在需要时从我正在尝试开发的Windows应用程序中检索它。我需要的东西,比如每当我想要读取数据时,我应该能够导入数据并在编写时我需要导出数据。
先谢谢,
Hi all,
Can anybody tell me how to save & retrieve data from local directory or PC's local disks without using database. Which is the better way to do it..? As the client system doesn't have a database so i need to use an alternative to save data & retrieve it whenever required from the windows application i am trying to develop. I need something like whenever i want to read data i should be in a position to import data & when writing i need to export data.
Thanks in advance,
推荐答案
有一些 巨大 的方法,包括原始文件,CSV和XML除了其他,但由于你在谈论数据库,我认为你需要某种形式的基于记录的存储。
最简单的解决方案是使用数据库 - 有几个它不需要用户安装,占地面积小。看看SQLCE和SQLite:既可以将您的应用程序作为小DLL文件安装,又允许您在应用程序中以单个用户形式使用(几乎)SQL Server的所有功能。或者,如果你是绝望的,有Access / Jet / Ace可以很好地完成单个用户。
如果你需要多用户访问,那么你需要咬紧牙关并安装一个正确的数据库:MySql的Sql Server,否则它太复杂了,无法处理你自己!
There are a huge number of ways you could do this, including a raw file, CSV, and XML among others, but since you are talking about databases I assume that you need some form of record based storage.
The simplest solution is to use a database - there are several which do not require user installation and which have a small footprint. Have a look at SQLCE and SQLite: both install with your application as small DLL files and allow you to use (nearly) all the features of SQL Server in a single user form in your application. Or, if you are desperate, there is Access/Jet/Ace which can do a good job single user.
If you need multi user access, then you need to bite the bullet and install a "proper" database: Sql Server of MySql as otherwise it gets far too complicated to process youself!
使用XML文件......
您可以使用DataSet或Tables简单地编写或读取它....
以最简单的方式在C#中使用XML [ ^ ]
或使用CSV(逗号分隔值)文件....
如果你想保存应用程序设置或一些值....在项目中使用App.Config ....
Use XML Files....
You can simply write or read it with DataSets or Tables....
Using XML in C# in the simplest way[^]
or use CSV (Comma Seperated Value) Files....
If you want to save Application Settings or a few values.... Use App.Config in project....
您可以尝试将其保存在记事本中
如何保存数据记事本 [ ^ ]
查看..
you can try saving it in notepad
how-to-save-data-in-notepad[^]
Check this..
这篇关于如何在windows应用程序中保存各个字段的参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文