GetPrivateProfileString INI получение имена всех section и key - C#
Формулировка задачи:
Как можно из ini файла достать имена section и key из под section?
[DllImport("kernel32")]
private static extern int GetPrivateProfileString(string section,
string key, string def, StringBuilder retVal,
int size, string filePath);
public string IniRead(string Section, string Key)
{
StringBuilder temp = new StringBuilder(255);
int i = GetPrivateProfileString(Section, Key, "", temp,
255, this.path);
return temp.ToString();
}
ап?
Решение задачи: «GetPrivateProfileString INI получение имена всех section и key»
textual
Листинг программы
[DllImport("kernel32")]
private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);
public string[] IniReadKey(string Section)
{
StringBuilder temp = new StringBuilder(65536);
int i = GetPrivateProfileString(Section, null, null, temp, 65536, this.path);
return temp.ToString().Split('\0');
}