A very useful module for reading and writing INI files in VB6New module (registry not recommended) named rwiniThe INI file may encounter an error when there is a carriage return or line break. After testing, the number of Chinese characters must be smaller than 86 bytes, and the value of English letters must be smaller than 143 bytes to return the list box. (This
ObjectiveUsing configuration files to flexibly configure some parameters is a common thing, configuration file parsing is not complicated, especially in Python, in the official release of the library contains a library to do this thing, that is ConfigparserThe format of the Configparser parsing configuration file is compared to the configuration file format of INI, that is, the file is composed of multiple sections, and there are multiple configuratio
In a lot of programs, We will see a file with an. ini suffix, this file can be very convenient to set up and read some of the program configuration information, such as when we do a program background login, need to automatically log in or remote configuration database connection, and save password settings and so on (in the WinForm program), if in the ASP. NET Program There is another workaround, this C # action
("studentinfo", "name", "default name", strstudname. getbuffer (max_path), max_path, "C: // stud // student. ini ");After execution, the value of strstudname is "Zhang San". If the first two parameters are incorrect, the value is "default name ".
3. Use another winapi function to read integer values:Uint getprivateprofileint (Lptstr lpappname,Lptstr lpkeyname,Int ndefault,Lptstr lpfilename);The parameters here have the same meaning as above. The usag
nstudage;Getprivateprofilestring ("studentinfo", "name", "default name", strstudname. getbuffer (max_path), max_path, "C: // stud // student. ini ");After execution, the value of strstudname is "Zhang San". If the first two parameters are incorrect, the value is "default name ".3. Use another winapi function to read integer values:Uint getprivateprofileint (Lptstr lpappname,Lptstr lpkeyname,Int ndefault,Lptstr lpfilename);The parameters here have the
;Getprivateprofilestring ("studentinfo", "name", "default name", strstudname. getbuffer (max_path), max_path, "C: // stud // student. ini ");Strstudname after executionThe value is "Zhang San". If the first two parameters are incorrect, the value is "default name ".
3. Use another winapi function to read integer values:UintGetprivateprofileint (Lptstr lpappname,Lptstr lpkeyname,IntNdefault,Lptstr lpfilename);The parameters here have the same meaning a
program.
Cstring strstudname;Int nstudage;Getprivateprofilestring ("studentinfo", "name", "default name", strstudname. getbuffer (max_path), max_path, "C: // stud // student. ini ");
After execution, the value of strstudname is "Zhang San". If the first two parameters are incorrect, the value is "default name ".
3. Use another winapi function to read integer values:
Uint getprivateprofileint (Lptstr lpappname,Lptstr lpkeyname,Int ndefault,Lpts
nstudage;Getprivateprofilestring ("studentinfo", "name", "default name", strstudname. getbuffer (max_path), max_path, "C: \ stud \ student. ini ");After execution, the value of strstudname is "Zhang San". If the first two parameters are incorrect, the value is "default name ".3. Use another winapi function to read integer values:Uint getprivateprofileint (Lptstr lpappname,Lptstr lpkeyname,Int ndefault,Lptstr lpfilename);The parameters here have the s
Please respect the original: Original address: Click to open the link
:: WritePrivateProfileString (_t ("Options"), _t ("Name"), M_strname, Papp->m_szini);INI file programming, WINAPI function Writeprivateprofilestring,getprivateprofilestring CollectionIn the program we write, there are always some configuration information to be saved, in order to complete the function of the program, the simplest way is to write this information into the
".
3.To read an integer value, use another winapi function:
Uint getprivateprofileint (
Lptstr lpappname,
Lptstr lpkeyname,
Int ndefault,
Lptstr lpfilename
);
The parameters here have the same meaning as above. The usage is as follows:
Nstudage = getprivateprofileint ("studentinfo", "Age", 10, "C: \ stud \ student. ini ");
3. Write multiple values cyclically. If you have a program, you need to save several recently used file names. The specific progr
into the program.
Cstring strstudname;Int nstudage;Getprivateprofilestring ("studentinfo", "name ","Default name ", strstudname. getbuffer (max_path), max_path," C: // stud // student. ini ");
After execution, the value of strstudname is "Zhang San". If the first two parameters are incorrect, the value is "default name ".
3. to read an integer value, use anotherWinapi functions:
Uint getprivateprofileint (Lptstr lpappname,Lpc
. defvalue in getinis and getinin is the default value of the keyword. valstr and valint of setinis and setinin are the values of the keywords to be written into the INI file. To better illustrate how to use the above functions and procedures, the following two instances are provided.Instance 1:Databases and other files are usually used for application development. The directories (including paths and file names) of these files should not be fixed in
Myinstall script instructions
Setup.exe is the installation file.Uninstall.exe is the uninstall file.Setup.bmp is the logo called by setup.exe. The size is 48 × 48 pixels. If not, use the built-in logo.Setup. INI is the installation configuration file used by setup.exe.All the installation modules are stored in sub-directories. Each sub-directory uses the mpcplugin. ini file (you can customize the file na
, keyword for keywords, getinis and getinin defvalue for the keyword defaults, setinis and Setinin Valstr and valint for the value of the keywords to be written to the INI file. To better illustrate how to use the above functions and procedures, here are two examples.
Example 1:
Development applications typically use databases and other files, directories (including paths and filenames) that should not be fixed in the program, but stored in the
A more complete Inno setup script, added to the INI file settings, a package of common features are available.[Plain]view plaincopy [setup]; Note: The value of appid is to identify the application separately. ; do not use the same AppID values for other installers. ; (Generate a new GUID, click Tool | To generate a GUID in the IDE.) ) appid={{a9861883-31c5-4324-bd9a-dc3271eeb675}; program name appname=issample Version number appvername=issample1.
In-depth understanding of ini configuration in php (1 ). In-depth understanding of ini configuration in php (1) This article will not detail the purpose of an ini configuration item, which has been explained in the manual. I just want to dig into the ini configuration in php from a specific point of view (1)
This artic
the delay time is exceeded, the default system is automatically started. We can change the default startup system to another system (such as Windows 98) as needed ). Right-click my computer, select properties, and click Advanced in the system Properties dialog box, then select the "Settings" button in the "Start and fault recovery" items below to bring up a "Start and fault recovery" dialog box (3 ). Click
Read and write INI file in VC + + Write INI fileCString Path,index;int i;Path= "d:/qc_download/bin_code/teu800_long_sms/";I=1;Index. Format (_t ("%d"), I);:: WritePrivateProfileString (_t ("Successcompath"),index,_t ("d:/qc_download/bin_code/teu800_long_sms/"), _t (".//ex1.ini"));The information in the INI file is this
In-depth understanding of ini configuration in php (1)This article does not describe the purpose of an ini configuration item in detail. These are all covered in the manual. I just want to explore the implementation mechanism of php from a specific point of view, which involves some knowledge about the php kernel:-) All php users know php. the ini configuration t
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.