Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. reading and replacing the ini files using c#

reading and replacing the ini files using c#

Scheduled Pinned Locked Moved C#
csharpdata-structures
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    varsh12
    wrote on last edited by
    #1

    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#

    OriginalGriffO P 2 Replies Last reply
    0
    • V varsh12

      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#

      OriginalGriffO Offline
      OriginalGriffO Offline
      OriginalGriff
      wrote on last edited by
      #2

      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 no idea what I did, but I'm taking full credit for it." - ThisOldTony
      "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

      V 2 Replies Last reply
      0
      • OriginalGriffO OriginalGriff

        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.

        V Offline
        V Offline
        varsh12
        wrote on last edited by
        #3

        hello! my requirement is to store multiple value as shown above, more or less 300

        1 Reply Last reply
        0
        • OriginalGriffO OriginalGriff

          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.

          V Offline
          V Offline
          varsh12
          wrote on last edited by
          #4

          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.

          L 1 Reply Last reply
          0
          • V varsh12

            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.

            L Offline
            L Offline
            Luc Pattyn
            wrote on last edited by
            #5

            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, a List<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.

            1 Reply Last reply
            0
            • V varsh12

              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#

              P Offline
              P Offline
              PIEBALDconsult
              wrote on last edited by
              #6

              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.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups