Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27189

StreamReader n StreamWriter with Config files (.ini or .cfg)

$
0
0
I wrote a little routine to read info from a config file & it works great. I am a little disappointed that I cannot simply search for a key word & write to the line I want on the fly. With the StreamWriter you can write strings consecutively or to a new line, but each time it erases the previous info when opened.

It seems silly why MS would have not given this much consideration at this day & age.

The only solution is to dump ALL OF THE INFO from a config file into an array, make the necessary WRITE changes in the array & then write it back into the config file. It seems unnecessary and wasteful, does it not or am I missing something?

I have heard of another way to do this using Windows API's & Kernel32, but I will have to investigate this further.



Here is the read snippet I wrote:
Attachment 98273
Attached Files

Viewing all articles
Browse latest Browse all 27189

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>