IniFile.SetKeyData Method

IniFileIO

IniFileSetKeyData Method

IniFileIO Documentation
Sets the data of the key with keyName within the specified IniFileSection. Optionally, this method will create the section and/or key as needed.

Namespace:  IniFileIO
Assembly:  IniFileIO (in IniFileIO.dll) Version: 1.4.0.6028 (1.4.0.06028)
Syntax

public bool SetKeyData(
	string sectionName,
	string keyName,
	string value = null,
	int order = 2147483647,
	string comments = null,
	bool createIfNotExist = true
)
Public Function SetKeyData ( 
	sectionName As String,
	keyName As String,
	Optional value As String = Nothing,
	Optional order As Integer = 2147483647,
	Optional comments As String = Nothing,
	Optional createIfNotExist As Boolean = true
) As Boolean
public:
bool SetKeyData(
	String^ sectionName, 
	String^ keyName, 
	String^ value = nullptr, 
	int order = 2147483647, 
	String^ comments = nullptr, 
	bool createIfNotExist = true
)
member SetKeyData : 
        sectionName : string * 
        keyName : string * 
        ?value : string * 
        ?order : int * 
        ?comments : string * 
        ?createIfNotExist : bool 
(* Defaults:
        let _value = defaultArg value null
        let _order = defaultArg order 2147483647
        let _comments = defaultArg comments null
        let _createIfNotExist = defaultArg createIfNotExist true
*)
-> bool 

Parameters

sectionName
Type: SystemString
Parent section to search.
keyName
Type: SystemString
Name of the target key.
value (Optional)
Type: SystemString
Value to set.
order (Optional)
Type: SystemInt32
Order to set.
comments (Optional)
Type: SystemString
Comments to set.
createIfNotExist (Optional)
Type: SystemBoolean
When True, if the target path of sectionName and/or keyName does not exist, it is created as needed. When False, if the path does not exist, no action is taken.

Return Value

Type: Boolean
Whether the specified key was updated or created. False should only be returned in calls where createIfNotExist is set to False.
Remarks

In the event of multiple keyNames within sectionName, only the first occurrance is updated.
See Also

Reference