C#: programatically i wanna do
In Admin tools: PErformance-> Performance Logs and Alerts
i want to create "Counter Logs"
New Log settings...
Basically for printer (for testing if a printer prints more than 10 pages in one time, processor usage exceeds 50% )...
i want logs to be created in Windows logs... Event viewer... I guess they do get created automatically.. ..
now next thing is if i can do the above programatically ... how do i filters the logs ... so that i know which once i created?....
is this code in right direction?
if(!Performance CounterCategory .Exists("Grudge 2"))
{
CounterCreation DataCollection mycounter = new CounterCreation DataCollection( );
CounterCreation Data test = new CounterCreation Data();
test.CounterNam e = "Vanessa";
test.CounterHel p="HALO";
test.CounterTyp e = PerformanceCoun terType.NumberO fItems32;
mycounter.Add(t est);
PerformanceCoun terCategory.Cre ate("Grudge 2","Sample",myc ounter);
}
In Admin tools: PErformance-> Performance Logs and Alerts
i want to create "Counter Logs"
New Log settings...
Basically for printer (for testing if a printer prints more than 10 pages in one time, processor usage exceeds 50% )...
i want logs to be created in Windows logs... Event viewer... I guess they do get created automatically.. ..
now next thing is if i can do the above programatically ... how do i filters the logs ... so that i know which once i created?....
is this code in right direction?
if(!Performance CounterCategory .Exists("Grudge 2"))
{
CounterCreation DataCollection mycounter = new CounterCreation DataCollection( );
CounterCreation Data test = new CounterCreation Data();
test.CounterNam e = "Vanessa";
test.CounterHel p="HALO";
test.CounterTyp e = PerformanceCoun terType.NumberO fItems32;
mycounter.Add(t est);
PerformanceCoun terCategory.Cre ate("Grudge 2","Sample",myc ounter);
}
Comment