IniFile

IniFile


Provides methods for manipulating an INI initialization file.


Implements:

IObject 

Public:

Properties:

NameDescription
 AutoFlush (get) Returns the auto-flush state of the object.  
 AutoFlush (let) Sets the auto-flush state of the object.  
 FileName (get) Returns the name of the INI file being manipulated.  

Methods:

NameDescription
 DeleteKey Deletes a key-value pair in a specific section within an INI file.  
 DeleteSection Deletes an entire section from an INI file, including all key-value pairs.  
 Equals Returns a boolean indicating if the value and this object instance are the same instance.  
 Flush Flushes any cached updates to the INI file. 
 GetBoolean Returns a Boolean value from the specified key in the specified section of an INI file.  
 GetByte Returns a Byte value from the specified key in the specified section of an INI file.  
 GetCurrency Returns a Currency value from the specified key in the specified section of an INI file.  
 GetDate Returns a Date value from the specified key in the specified section of an INI file.  
 GetDateTime Returns a CorDateTime value from the specified key in the specified section of an INI file.  
 GetDecimal Returns a Decimal value from the specified key in the specified section of an INI file.  
 GetDouble Returns a Double value from the specified key in the specified section of an INI file.  
 GetHashCode Returns a pseudo-unique number identifying this instance.  
 GetInt16 Returns a Integer value from the specified key in the specified section of an INI file.  
 GetInt32 Returns a Long value from the specified key in the specified section of an INI file.  
 GetKeyNames Returns a list of key names in an INI file.  
 GetSectionNames Returns a list of section names in an INI file.  
 GetSectionWriter Returns a IniResourceWriter used to create an entire section withing an INI file at once.  
 GetSingle Returns a Single value from the specified key in the specified section of an INI file.  
 GetString Returns the string value of the specified key in the specified section of an INI file.  
 GetTimeSpan Returns a TimeSpan value from the specified key in the specified section of an INI file.  
 GetValues Returns an IDictionary object containing the key-value pairs from a section in an INI file.  
 SetValue Sets a key-value pair within a section of an INI file.  
 ToString Returns a string representation of this object instance.  

Remarks

An INI file contains sections in a format like

[section]
key=value

A new IniFile object can be created using the NewIniFile method.

 Dim ini As IniFile
 Set ini = NewIniFile("c:\settings.ini")
 

If the file name does not specify the directory, then the file will be created in the Windows directory. In order to specify the current directory, preceed the file name with a current directory symbol ".".

 Dim Ini As IniFile
 Set Ini = NewIniFile(".\local.ini")
 

See Also

Project CorLib Overview

Class IniFile Overview

IniResourceWriter