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;))
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.
Be sure that you are: using System.Diagnostics
Then, in your code, you can use the configured switch by creating a TraceSwitch with the same name as in your config file: TraceSwitch appSwitch = new TraceSwitch("Trace", "");
The value you want to retrieve is appSwitch.Level (which in your case will be Verbose, as you have the value set to 4 in your config file.
I think what he is referring to is creating your own custom control that will draw the graphics how you want using the Graphics object provided in the OnPaint method of UserControls.
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
the problem is this that I m monitoring a microcontroller through a serial port the serial port have to monitor continuousy. Do some one have any code to monitor the serial port continuosly that when data arrives at the serial port either a character or a number of characters the serial port read it and proces it further .
Also why when I moved toolStrip and menuStrip controls to toolStip Container I added lately all event handlers where removed rendering all menu and tool strip items not working, had to manually double click each item then rename old event handler methods to new created on double click to make all things work again
basically for example event that had click stopped working and new was now click_1 so I had to remove new empty click_1 and rename old click to click_1.