reading and replacing the ini files using c#
-
hi! i have an ini files. in this file, the value is in following format: abc= mno xyz=ijk efg=pqr and so on..... my need is that i have to store the value before= (abc,xyz) in an array and after=(mno,ijk) in another array. and after storing the value in an array, replace abc with mno and so on in C#
-
hi! i have an ini files. in this file, the value is in following format: abc= mno xyz=ijk efg=pqr and so on..... my need is that i have to store the value before= (abc,xyz) in an array and after=(mno,ijk) in another array. and after storing the value in an array, replace abc with mno and so on in C#
And what part of this is giving you a problem? And why are you using .INI files anyway - they pretty much went out with Win98!
Did you know: That by counting the rings on a tree trunk, you can tell how many other trees it has slept with.
-
And what part of this is giving you a problem? And why are you using .INI files anyway - they pretty much went out with Win98!
Did you know: That by counting the rings on a tree trunk, you can tell how many other trees it has slept with.
-
And what part of this is giving you a problem? And why are you using .INI files anyway - they pretty much went out with Win98!
Did you know: That by counting the rings on a tree trunk, you can tell how many other trees it has slept with.
-
i have solved to read and replacing method. but can u tell me what the procedures to store the value as i ask in my question.
assuming the order is not important and all keys are unique, I would store all this "key=value" information into a
Dictionary<key, value>
. If order is relevant or duplicate keys could exist, aList<KeyValuePair<key, value>>
could do. And use string type for key, and probably for value too. :)Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.
-
hi! i have an ini files. in this file, the value is in following format: abc= mno xyz=ijk efg=pqr and so on..... my need is that i have to store the value before= (abc,xyz) in an array and after=(mno,ijk) in another array. and after storing the value in an array, replace abc with mno and so on in C#
ahmad25 wrote:
replace abc with mno and so on in C#
Do you mean replace like with the "C-Preprocessor"? Using two arrays is not the way to go in any case.