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. Other Discussions
  3. The Weird and The Wonderful
  4. Accessing the app.config...

Accessing the app.config...

Scheduled Pinned Locked Moved The Weird and The Wonderful
9 Posts 7 Posters 12 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.
  • M Offline
    M Offline
    Megidolaon
    wrote on last edited by
    #1

    This is some old code I wrote...old as in 2 days old :doh:

    XmlDocument config = new XmlDocument();
    config.LoadXml(new StreamReader(Application.ExecutablePath + ".config").ReadToEnd());
    string connection = config.ChildNodes[1].ChildNodes[1].ChildNodes[0].Attributes["connectionString"].InnerText;

    I dunno, app.config seems to hate me. No matter what I try, no matter how many tutorials I read, it never works.

    C P 2 Replies Last reply
    0
    • M Megidolaon

      This is some old code I wrote...old as in 2 days old :doh:

      XmlDocument config = new XmlDocument();
      config.LoadXml(new StreamReader(Application.ExecutablePath + ".config").ReadToEnd());
      string connection = config.ChildNodes[1].ChildNodes[1].ChildNodes[0].Attributes["connectionString"].InnerText;

      I dunno, app.config seems to hate me. No matter what I try, no matter how many tutorials I read, it never works.

      C Offline
      C Offline
      Chris Maunder
      wrote on last edited by
      #2

      Post this in the correct forum and I can help (hint: namespaces) But in the meantime PLEASE do some checks on return values in each step. My eyes are watering just looking at it.

      cheers, Chris Maunder

      CodeProject.com : C++ MVP

      K 1 Reply Last reply
      0
      • M Megidolaon

        This is some old code I wrote...old as in 2 days old :doh:

        XmlDocument config = new XmlDocument();
        config.LoadXml(new StreamReader(Application.ExecutablePath + ".config").ReadToEnd());
        string connection = config.ChildNodes[1].ChildNodes[1].ChildNodes[0].Attributes["connectionString"].InnerText;

        I dunno, app.config seems to hate me. No matter what I try, no matter how many tutorials I read, it never works.

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

        Roll your own.

        D 1 Reply Last reply
        0
        • C Chris Maunder

          Post this in the correct forum and I can help (hint: namespaces) But in the meantime PLEASE do some checks on return values in each step. My eyes are watering just looking at it.

          cheers, Chris Maunder

          CodeProject.com : C++ MVP

          K Offline
          K Offline
          Kartik Rathi
          wrote on last edited by
          #4

          i am new to this message board

          K N realJSOPR 3 Replies Last reply
          0
          • K Kartik Rathi

            i am new to this message board

            K Offline
            K Offline
            Kartik Rathi
            wrote on last edited by
            #5

            1

            K 1 Reply Last reply
            0
            • K Kartik Rathi

              1

              K Offline
              K Offline
              Kartik Rathi
              wrote on last edited by
              #6

              2

              1 Reply Last reply
              0
              • K Kartik Rathi

                i am new to this message board

                N Offline
                N Offline
                Nelek
                wrote on last edited by
                #7

                And spam is the best way to get started :doh: (note the irony)

                Greetings. -------- M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you “The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson Rating helpfull answers is nice, but saying thanks can be even nicer.

                1 Reply Last reply
                0
                • P PIEBALDconsult

                  Roll your own.

                  D Offline
                  D Offline
                  Dave Sexton
                  wrote on last edited by
                  #8

                  :)

                  But fortunately we have the nanny-state politicians who can step in to protect us poor stupid consumers, most of whom would not know a JVM from a frozen chicken. Bruce Pierson
                  Because programming is an art, not a science. Marc Clifton
                  I gave up when I couldn't spell "egg". Justine Allen

                  1 Reply Last reply
                  0
                  • K Kartik Rathi

                    i am new to this message board

                    realJSOPR Offline
                    realJSOPR Offline
                    realJSOP
                    wrote on last edited by
                    #9

                    That doesn't forgive you the responsibility of becoming familiar with the rules before you start posting.

                    "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
                    -----
                    "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

                    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