Use VC to access the INI file and system registry

xiaoxiao2021-03-06  63

Http://www.yesky.com/softchannel/72342371928702976/20040729/1836684.shtml

[Article] Author: China Institute of Radio Wave Propagation, Qingdao Branch Rui Lang Time: 2004-07-29 Source: NEW YORK Editor: Ark

[Article Guide] This article is mainly discussed in more detailed discussion on the access method of private, system initialization documents and system registry.

[Text] 1 2 3 4 5 Next

Abstract: This article focuses on the access method of private, system initialization documents, and system registry. Key words: VC 6.0; initialization file; system registry; .ini file INI file (Initialization File, also known as an initialization file) is a special ASCII file used to save application settings and options, ". INI "as a file extension, also known as a configuration file or profile (Profile). In addition to each application, the Windows system also provides a system's initialization file WIN.INI, and thereby configures the current Windows system, and other applications within the system can be recorded. Options at runtime. It is usually relatively small for initialization files privately available to the application, which can reduce the amount of information read when the program is initialized, thereby increasing the startup speed of the program. And the system initialization file Win.ini has stored the initialization data of many other application software, so it is often much larger than the private configuration files, which are usually large and accessible. If there is no need, it is generally not recommended to operate the Win.ini file, but if the information to be accessed involves the Windows system environment or other applications, Win.ini must be read and write, and at the same time Send a WM_WININICHANGE message to all top windows, notifying other process system initialization files have been changed. The information in the configuration file can be read and identified for the system and many different types of applications. It is due to the pre-conventional "Entry-Value PAIRS" storage structure due to the internal access to the data. And store the data slogan to access. Below is some of the contents of the Win.ini file under the system directory:

[Windows] Load = run = nullport = none [desktop] WallPaperStyle = 2 Pattern = (None) Here, the configuration file is divided into several "section", and the title is placed in square brackets, such as "[desktop]" Desktop section, contains some "item" associated with it in each section, and assigns it by equal sign. The general form is as follows:

[Section] entry = value In the initialization file, the value value can only have two data types: numeric and string. Windows provides two sets of API functions for both API functions for both API functions, respectively, when writing initialization files, only supports the number of data types, and the number of values, etc. Can you write to an initialization file. ................................................

............

转载请注明原文地址:https://www.9cbs.com/read-91537.html

New Post(0)