C# Класс BEGroup.Utility.IniFile

Represents a Windows standard INI file
Показать файл Открыть проект

Открытые методы

Метод Описание
Clear ( ) : void

Clears the entire INI file.

ContainsKey ( string section, string key ) : bool

Determines whether this INI file contains the specified key in the specified section.

ContainsSection ( string section ) : bool

Determines whether this INI file contains the specified section.

CreateKey ( string section, string key ) : void

Creates an empty key to this INI file, if the key already exists, nothing will be done. If the section does not exist, it will be created.

CreateSection ( string section ) : void

Creates an empty section to this INI file, if the section already exists, nothing will be done.

GetValue ( string section, string key ) : string

Gets the value with the specified section and the specified key.

IniFile ( string path ) : System

Opens the specified INI file, if the file does not exist, create one.

RemoveKey ( string section, string key ) : void

Removes the specified key in the specified section, if the key and/or section does not exist, nothing will be done.

RemoveKeysStartsWith ( string section, string startsWith, bool ignoreCase = true ) : void

Removes all key/value pairs that with the key starts with the specified string in the specified section.

RemoveSection ( string section ) : void

Removes the specified section and all its key/value pairs, if the section does not exist, nothing will be done.

RemoveSectionsStartsWith ( string startsWith, bool ignoreCase = true ) : void

Removes all sections that with the name starts with the specified string.

Save ( ) : void

Saves the current INI file.

SaveAs ( string path, bool overwrite = true ) : void

Saves this INI file to the specified path.

SetValue ( string section, string key, string value ) : void

Sets the value of the specified key in the specified section. If the section and/or key does not exist, they will be created.

Описание методов

Clear() публичный Метод

Clears the entire INI file.
public Clear ( ) : void
Результат void

ContainsKey() публичный Метод

Determines whether this INI file contains the specified key in the specified section.
public ContainsKey ( string section, string key ) : bool
section string Section name
key string Key name
Результат bool

ContainsSection() публичный Метод

Determines whether this INI file contains the specified section.
public ContainsSection ( string section ) : bool
section string Section name
Результат bool

CreateKey() публичный Метод

Creates an empty key to this INI file, if the key already exists, nothing will be done. If the section does not exist, it will be created.
public CreateKey ( string section, string key ) : void
section string Section name
key string Key name
Результат void

CreateSection() публичный Метод

Creates an empty section to this INI file, if the section already exists, nothing will be done.
public CreateSection ( string section ) : void
section string Section name
Результат void

GetValue() публичный Метод

Gets the value with the specified section and the specified key.
public GetValue ( string section, string key ) : string
section string Section name
key string Key name
Результат string

IniFile() публичный Метод

Opens the specified INI file, if the file does not exist, create one.
public IniFile ( string path ) : System
path string Path of the file
Результат System

RemoveKey() публичный Метод

Removes the specified key in the specified section, if the key and/or section does not exist, nothing will be done.
public RemoveKey ( string section, string key ) : void
section string Section name
key string Key name
Результат void

RemoveKeysStartsWith() публичный Метод

Removes all key/value pairs that with the key starts with the specified string in the specified section.
public RemoveKeysStartsWith ( string section, string startsWith, bool ignoreCase = true ) : void
section string Section name
startsWith string Starts with string
ignoreCase bool true to ignore case; otherwise false
Результат void

RemoveSection() публичный Метод

Removes the specified section and all its key/value pairs, if the section does not exist, nothing will be done.
public RemoveSection ( string section ) : void
section string Section name
Результат void

RemoveSectionsStartsWith() публичный Метод

Removes all sections that with the name starts with the specified string.
public RemoveSectionsStartsWith ( string startsWith, bool ignoreCase = true ) : void
startsWith string Starts with string
ignoreCase bool true to ignore case; otherwise false
Результат void

Save() публичный Метод

Saves the current INI file.
public Save ( ) : void
Результат void

SaveAs() публичный Метод

Saves this INI file to the specified path.
public SaveAs ( string path, bool overwrite = true ) : void
path string Path of the INI file
overwrite bool whether to overwrite if the target file exists
Результат void

SetValue() публичный Метод

Sets the value of the specified key in the specified section. If the section and/or key does not exist, they will be created.
public SetValue ( string section, string key, string value ) : void
section string Section name
key string Key name
value string Value
Результат void