Open Rails

NativeMethods.GetPrivateProfileSection Method

[This is preliminary documentation and subject to change.]

Retrieves all the keys and values for the specified section of an initialization file.

[PreserveSig]
[DllImport(EntryPoint=""GetPrivateProfileSection"", CharSet=CharSet.Unicode, SetLastError=True, ExactSpelling=False, PreserveSig=True, CallingConvention=CallingConvention.Winapi, BestFitMapping=False, ThrowOnUnmappableChar=False, Value=""kernel32.dll"")]
public static int GetPrivateProfileSection(
   string sectionName,
   string value,
   int size,
   string fileName
);

Parameters

sectionName
The name of the section in the initialization file.
value
A pointer to a buffer that receives the key name and value pairs associated with the named section. The buffer is filled with one or more null-terminated strings; the last string is followed by a second null character.
size
The size of the buffer pointed to by the value parameter, in characters. The maximum profile section size is 32,767 characters.
fileName
The name of the initialization file. If this parameter does not contain a full path to the file, the system searches for the file in the Windows directory.

Return Value

The return value specifies the number of characters copied to the buffer, not including the terminating null character. If the buffer is not large enough to contain all the key name and value pairs associated with the named section, the return value is equal to size minus two.

See Also

NativeMethods Class | ORTS.Common Namespace