C#

Moderators: None (Apply to moderate this forum)
Number of threads: 2712
Number of posts: 5738

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
XMl Config Posted by Shecuna on 1 Apr 2011 at 2:12 AM
Hello ;)

I got a problem ...
I have a XML-Config File for my C#-Programm and i want to store useable ports in it. So it looks like this:
<configuration>
  <!-- Allgemeine Einstellungen -->
  <Properties>
    
    <Error_Config
          Error_Port = "5000"
          Error_Example = "Example"
    />
    
    <Class1>
       <Config
          Config_Data = "10"
          Config_Port = "1025"
       />
    </Class1>

  </Properties>
  <appSettings>
  </appSettings>
</configuration>

// Just an example ... //

I could use the AppSettings Section, but i cant "group" my keys in this Section = /
So i have to make my own Section called Properties.
There is this class AppSettingsReader. But afaik it can only read out of the AppSection. I googled a while and everything i found was a post on msdn-forum that uses Hashtables to get this data ... Thats a bit complicated ...
Is there a simplier way to read this data ? AppSettingsReader is very simple to use ... Is there a class similar to ASR that can read out of all sections ?
I know there is Configuration.ConfigurationManager, but it just works with Hashtables (says MSDN)

Anyone can help ?

greets Shecuna



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.