I thought I knew how to do this, but I can't find my example I stored away years ago...
I am writing a small app in VB.NET and it needs to be able to read data out of an INI file. Problem is, in this case, that the section names in the INI file are unknown until the app gets access to the file. The format of each section is the same (4 string values with thr same identifiers) but the section names are always different.
I thought there was a way using the API call GetPrivateProfileString to get the section names out of the file, so I could store them in an array and then go back and read out the vlaues for each section. But I can't find my example (everything I have indicates I need to know the section name ahead of time).
I suppose I could just use a data reader and parse out the contents of the file, looking for values within brackets, then do the GetPrivateProfileString operation once I knew the values, but I really would prefer a more direct way.
Can anyone help?
I am writing a small app in VB.NET and it needs to be able to read data out of an INI file. Problem is, in this case, that the section names in the INI file are unknown until the app gets access to the file. The format of each section is the same (4 string values with thr same identifiers) but the section names are always different.
I thought there was a way using the API call GetPrivateProfileString to get the section names out of the file, so I could store them in an array and then go back and read out the vlaues for each section. But I can't find my example (everything I have indicates I need to know the section name ahead of time).
I suppose I could just use a data reader and parse out the contents of the file, looking for values within brackets, then do the GetPrivateProfileString operation once I knew the values, but I really would prefer a more direct way.
Can anyone help?