字符串和整数访问和保存 [英] strings and integers accessing and saving

查看:50
本文介绍了字符串和整数访问和保存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Goodday,我在完成一个项目时遇到了一些问题.我对delphi并没有很丰富的经验,但也不错.

Goodday, I have a little problem finishing off a project. I am not very experienced with delp but not too bad either.

我正在创建一个项目,使人们可以通过delphi中的Twebbrowser在网站上一次填充两个空间.例如,以任何网站的帐户创建页面为例,假设有4个键入字段(输入字段),名字,姓氏,密码和重复密码.我只是编造了这些,但它们应该让我理解得足够多.每个字段都是一种形式.该网站属于我,我对此一无所知.名和姓的格式为1,密码为格式2.现在,我想创建某种表,可以在其中写这些值,如下所示:

I am creating a project where people can fill two spaces at once on a website via the Twebbrowser in delphi. For example take a account creating page of any website and lets say there are 4 typing fields(input fields), firstname, lastname, password and repeat password. I just made these up but they should let me understand enough. Every field is in a form. The website is mine and I know everything about it. Firstname and lastname are in form 1 and the passwords are in form 2. Now I want to create some sort of table where I can write these values like so:

|名|1 |姓|1 |

| firstname | 1 | lastname | 1 |

|密码2 |重复密码|2 |

| password | 2 | repeatpassword | 2 |

我想将其保存到任何类型的文件中,然后在打开时再次读取.这个想法是4列,对于初学者来说是2行.稍后可能会扩展它.但是重要的是,找到姓氏ID时,可以访问其形式和姓氏+其形式,而不能访问密码中的形式.我希望这足以说明该项目.为此,数据库似乎太复杂了.

I want to save this to a file of any type and read from it again when I open it. The idea is 4 columns and for starters 2 rows. Might expand it later. But it is important that when the firstname id is found, its form and lastname + its form are accessible and not the ones from password. I hope this explains the project well enough. Databases seem too complicated for this.

现在我的问题是:将这些字符串和值保存到文件中以便可以从delphi表单中访问它们(并对其进行编辑)的最佳方法是什么?

Now my question is: What is the best way to save these strings and values to a file so that they can be accessed from the delphi form(and edited)?

推荐答案

如果只有少数几个字段,那么inifile是一个很好的解决方案.您可以使用TIniFile类轻松读取和写入信息.

If you got only a handful of fields, an inifile is a good and easy solution. You can use the TIniFile class to easily read and write to inifiles.

这篇关于字符串和整数访问和保存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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