Class IniFileReader
Provide a managed interface to GetPrivateProfileString in the Windows API, with methods to retrieve the values of individual keys and lists of the keys in a section or the sections in a file.
Inheritance
Namespace: WizardWrx.DLLConfigurationManager
Assembly: WizardWrx.DLLConfigurationManager.dll
Syntax
public class IniFileReader : object
Constructors
| Improve this Doc View SourceIniFileReader(String)
Construct an instance of the class.
Declaration
public IniFileReader(string INIPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | INIPath | This string must be the fully qualified name of a well formed private profile (INI) file. |
Fields
| Improve this Doc View Sourcepath
This string holds the fully qualified name of the private profile file to process, which is passed into the constructor, but can be changed as needed.
Declaration
public string path
Field Value
Type | Description |
---|---|
System.String |
Methods
| Improve this Doc View SourceGetEntryNames(String)
The Function called to obtain the EntryKeys from the given SectionHeader string passed, and returns them in an Dynamic Array
Declaration
public string[] GetEntryNames(string section)
Parameters
Type | Name | Description |
---|---|---|
System.String | section | This string must be the name of a section which is expected to be present, though possibly empty. |
Returns
Type | Description |
---|---|
System.String[] | The return value is an array of strings, each of which is the name of a key (entry) in the specified section. |
GetEntryValue(String, String)
The Function called to obtain the EntryKey Value from the given SectionHeader and EntryKey string passed, then returned
Declaration
public string GetEntryValue(string section, string entry)
Parameters
Type | Name | Description |
---|---|---|
System.String | section | This string must be the name of a section that is expected to exist. |
System.String | entry | This string must be the name of a key (entry) that is expected to exist, though it might be empty. |
Returns
Type | Description |
---|---|
System.String | The return value is a string, which may be empty. |
GetSectionNames()
The Function called to obtain the SectionHeaders, and returns them in an Dynamic Array
Declaration
public string[] GetSectionNames()
Returns
Type | Description |
---|---|
System.String[] | The return value is an array of strings, each of which is the name of a section. |