Hy guys, I'm new here and I have one error...

I wanna read from one *.ini file but not clasic read.

Here is content of file confing.ini that I wanna read:

String0=some text1
String1=some text2
String2=some text3

Read that I wanna get is value of String1 for example, in this case some text2.

Is this possible and if it is how can I made that?


I've done some of this in vb6 in the past. I dont think you can get exacly what you want out of the file but you can read it line by line and filter till you get what you want out of it. For just reading a file i think you can find code easily. I would find some code for you but i ma in a big hurry. Maybe when i get back if you still need it.


Well this is possible in VB.NET as Daniel puts it. You will need to read the file line at a time (loop through file records) and store the line result to a variable. Use the split function and = as the separator.

i.e. Dim strVariable() as string = split(FileRecordVariable,"=")

This statement will return an array strVariable with two contents in index 0 and 1. The stVariable(1) is what I guess you are looking for.

I wasn't sure about the code since i didnt use it in vb.net yet but it didnt change much :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.