Delphi Programming Control INI File

Source: Internet
Author: User
Tags ini

Get a string from an. ini file

Var

Strresult:pchar;

Begin

GetPrivateProfileString (

Name of the title in ' Windows ',//[]

' Nullport ',//= before the name

' NIL ',//If the string is not found, the default value returned

Strresult,//Store get character

100,//Get maximum allowable length of character

' C:forwin95win.ini '//called filename

);

Edit1.text:=strresult; Show Get string

Get an integer from an. ini file

Edit1.text:=inttostr (Getprivateprofileint (

The name of the title of ' Intl ',//[]

' Icountry ',//= before the name

0,//If an integer is not found, the default value returned

' C:forwin95win.ini '//called filename

));

Writing a string to an. ini file

WritePrivateProfileString (

Name of the title in ' Windows ',//[]

' Load ',//string to be written before ' = '

' Accca ',//data to be written

' C:forwin95win.ini '//called filename

);

Writing an integer to an. ini file

Writeprivateprofilesection (

Name of the title in ' Windows ',//[]

' read=100 ',//data to be written

' C:forwin95win.ini '//called filename

);

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.