Наши проекты:
Журнал · Discuz!ML · Wiki · DRKB · Помощь проекту |
||
ПРАВИЛА | FAQ | Помощь | Поиск | Участники | Календарь | Избранное | RSS |
[18.118.0.240] |
|
Сообщ.
#1
,
|
|
|
Приветствую Всех!
Возникла проблема работы с содержимым ini файлов. Подскажите как с ними работать. Спасибо. |
Сообщ.
#2
,
|
|
|
Как с любыми другими текстовыми файлами - StreamReader+FileStream
А вообще для хранения настроек в .NET используется XML |
Сообщ.
#3
,
|
|
|
andrey А пример можно. Только начинаю изучать С#.
|
Сообщ.
#4
,
|
|
|
есть апишная функция для чтения и записи в ini. С третей винды осталась, сам не работал с ней но знаю что есть..
Цитата andrey @ А вообще для хранения настроек в .NET используется XML |
Сообщ.
#5
,
|
|
|
Цитата А пример можно. http://wladm.narod.ru/C_Sharp/filesstreams.html |
Сообщ.
#6
,
|
|
|
Цитата nikf @ есть апишная функция для чтения и записи в ini. А какая? В с++ понятно, эти: Цитата GetPrivateProfileInt Retrieves an integer associated with a key in the specified section of an initialization file. GetPrivateProfileSection Retrieves all the keys and values for the specified section of an initialization file. GetPrivateProfileSectionNames Retrieves the names of all sections in an initialization file. GetPrivateProfileString Retrieves a string from the specified section in an initialization file. GetPrivateProfileStruct Retrieves the data associated with a key in the specified section of an initialization file. WritePrivateProfileSection Replaces the keys and values for the specified section in an initialization file. WritePrivateProfileString Copies a string into the specified section of an initialization file. WritePrivateProfileStruct Copies data into a key in the specified section of an initialization file. А в C#? |
Сообщ.
#7
,
|
|
|
Цитата А в C#? Те же, что и в C++. Из .NET апишные ф-ии вызываются через pInvoke.(см. DllImport в msdn). |
Сообщ.
#8
,
|
|
|
Цитата GazOn @ Те же, что и в C++. Из .NET апишные ф-ии вызываются через pInvoke.(см. DllImport в msdn). Спасибо разобрался. Пример как работать с ini файлами, если кому понадобиться, в аттаче. А где посмотреть примеры как с XML работать? Спасибо. Прикреплённый файлIniFile.rar (11.7 Кбайт, скачиваний: 174) |
Сообщ.
#9
,
|
|
|
Цитата А где посмотреть примеры как с XML работать http://www.rsdn.ru/article/dotnet/dnetappcfg.xml |