Click here to Skip to main content
16,004,977 members
Home / Discussions / C#
   

C#

 
AnswerRe: Windows list dropdown problem Pin
Christian Graus8-Jan-07 9:19
protectorChristian Graus8-Jan-07 9:19 
GeneralRe: Windows list dropdown problem Pin
Matthew Cuba8-Jan-07 10:22
Matthew Cuba8-Jan-07 10:22 
QuestionHow to save page as MHT with ASP/C# Pin
Todd82TA8-Jan-07 9:14
Todd82TA8-Jan-07 9:14 
AnswerRe: How to save page as MHT with ASP/C# Pin
Christian Graus8-Jan-07 9:24
protectorChristian Graus8-Jan-07 9:24 
Question"coselecting" text in a TextBox or RichTextBox Pin
Clive Pottinger8-Jan-07 8:57
Clive Pottinger8-Jan-07 8:57 
AnswerRe: "coselecting" text in a TextBox or RichTextBox Pin
Luc Pattyn8-Jan-07 9:55
sitebuilderLuc Pattyn8-Jan-07 9:55 
QuestionMDI Menustrip not merged (bug?) Pin
AndrusM8-Jan-07 8:56
AndrusM8-Jan-07 8:56 
QuestionRead config file with OpenExeConfiguration? [modified] Pin
Marcus_28-Jan-07 8:12
Marcus_28-Jan-07 8:12 
Hello. Right now I admit defeat and don't know how to do this. I have a configuration file that I have to load at runtime and interpret. This works fine for all the settings in the appSettings sections but I don't know how to get the value from the system.diagnostics section.

This is an example of an config file (in "real" a lot bigger;))
<configuration>
  <appSettings>
    <add key="Hello" value="World" />
  </appSettings>
  
  <system.diagnostics>
    <switches>
      <add name="Trace" value="4" />
    </switches>
  </system.diagnostics>

</configuration>


To load the file I use the OpenExeConfiguration method and most of the data I can get to, but not the "Trace" value from the system.diagnostics.
<code>// Get the configuration file.
System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration("c:\\projext1.exe");

MessageBox.Show(config.AppSettings.Settings["Hello"].Value);  //this shows OK

ConfigurationSection sel = config.Sections["system.diagnostics"]; // Here I find the section, but then...  ???
</code>


Does anybody have any idea on how to get the value? A possible solution might be to load the file into XML, but I'm still hoping on using the Configuration object. Hope you can stand my bad english and thanks to enybody that have a suggestion.


Edit: formatting... Sigh | :sigh:
AnswerRe: Read config file with OpenExeConfiguration? Pin
Mircea Puiu8-Jan-07 23:43
Mircea Puiu8-Jan-07 23:43 
QuestionGraphing in C#, Possible? Pin
gvanto8-Jan-07 8:04
gvanto8-Jan-07 8:04 
AnswerRe: Graphing in C#, Possible? Pin
gnadeem8-Jan-07 8:34
gnadeem8-Jan-07 8:34 
AnswerRe: Graphing in C#, Possible? Pin
Guffa8-Jan-07 8:59
Guffa8-Jan-07 8:59 
GeneralRe: Graphing in C#, Possible? Pin
gvanto8-Jan-07 9:16
gvanto8-Jan-07 9:16 
GeneralRe: Graphing in C#, Possible? Pin
Christian Graus8-Jan-07 9:28
protectorChristian Graus8-Jan-07 9:28 
GeneralRe: Graphing in C#, Possible? Pin
Thomas Stockwell8-Jan-07 9:51
professionalThomas Stockwell8-Jan-07 9:51 
GeneralRe: Graphing in C#, Possible? Pin
gvanto8-Jan-07 10:02
gvanto8-Jan-07 10:02 
GeneralRe: Graphing in C#, Possible? Pin
led mike8-Jan-07 10:13
led mike8-Jan-07 10:13 
GeneralRe: Graphing in C#, Possible? Pin
gvanto8-Jan-07 10:15
gvanto8-Jan-07 10:15 
GeneralRe: Graphing in C#, Possible? Pin
led mike8-Jan-07 10:25
led mike8-Jan-07 10:25 
Questionany book for c# graphics Pin
samreengr88-Jan-07 6:41
samreengr88-Jan-07 6:41 
AnswerRe: any book for c# graphics Pin
ednrgc8-Jan-07 6:56
ednrgc8-Jan-07 6:56 
AnswerRe: any book for c# graphics Pin
Christian Graus8-Jan-07 9:30
protectorChristian Graus8-Jan-07 9:30 
QuestionSerial Port Monitoring Pin
sajid.salim.khan8-Jan-07 6:06
sajid.salim.khan8-Jan-07 6:06 
AnswerRe: Serial Port Monitoring Pin
led mike8-Jan-07 6:32
led mike8-Jan-07 6:32 
GeneralBut Sir Pin
sajid.salim.khan8-Jan-07 6:43
sajid.salim.khan8-Jan-07 6:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.