Tuesday, September 27, 2011

value from the enum ?

Question:

      Is there any way that I can access the assigned value from the enum?

 

                Eg: When my item is Red then I want get the corresponding value That’s ‘R’. Is that possible?

public enum Color

      {

          Red = 'R',

          Blue = 'B',

          Green ='G',

          Yellow ='Y',

          White = 'W'

      }

 

Answer:

 

Yes by this way –

 

    class Program

    {

        static void Main(string[] args)

        {

            Console.WriteLine((char)Color.Red);

        }

    }

 

    public enum Color

      {

          Red = 'R',

          Blue = 'B',

          Green ='G',

          Yellow ='Y',

          White = 'W'

      }

 

Friday, September 23, 2011

Tracking CPU and Memory usage per process

Just type perfmon into Start > Run and press enter. When the Performance window is open, click on the + sign to add new counters to the graph. The counters are different aspects of how your PC works and are grouped by similarity into groups called "Performance Object".

 

For your questions, you can choose the "Process", "Memory" and "Processor" performance objects. You then can see these counters in real time

 

You can also specify the utility to save the performance data for your inspection later. To do this, select "Performance Logs and Alerts" in the left-hand panel. (It's right under the System Monitor console which provides us with the above mentioned counters. If it is not there, click "File" > "Add/remove snap-in", click Add and select "Performance Logs and Alerts" in the list".) From the "Performance Logs and Alerts", create a new monitoring configuration under "Counter Logs". Then you can add the counters, specify the sampling rate, the log format (binary or plain text) and log location.

 

 

For more information follow this link.

 

http://stackoverflow.com/questions/69332/tracking-cpu-and-memory-usage-per-process

Code Formater

Paste Here Your Source Code
Source Code Formatting Options
1) Convert Tab into Space :
2) Need Line Code Numbering :
3) Remove blank lines :
4) Embeded styles / Stylesheet :
5) Code Block Width :
6) Code Block Height :
7) Alternative Background :
Copy Formatted Source Code
 
Preview Of Formatted Code