niedziela, 25 grudnia 2016

Component PerformanceCounter in Visual C++



#pragma endregion
private: System::Void button2_Click(System::Object^  sender, System::EventArgs^  e) {
Close();
}
private: System::Void Form1_Load(System::Object^  sender, System::EventArgs^  e) {
timer1->Enabled=false;
}
private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
timer1->Enabled=true;
}
private: System::Void timer1_Tick(System::Object^  sender, System::EventArgs^  e) {

label4->Text=Memory->NextValue().ToString()+"%";
label5->Text=Disc->NextValue().ToString()+"%";
label6->Text=CPU->NextValue().ToString()+"%";
System::Double proc_CPU;
System::Double proc_Memory;
System::Double proc_Disc;
proc_CPU=Double::Parse(CPU->NextValue().ToString());
if (proc_CPU<1.)
proc_CPU+=1;
proc_Memory=Double::Parse(Memory->NextValue().ToString());
if (proc_Memory<1.)
 proc_Memory+=1;

proc_Disc=Double::Parse(Disc->NextValue().ToString());
if (proc_Disc<1.)
 proc_Disc+=1;
progressBar1->Value=proc_Memory;
progressBar2->Value=proc_Disc;
progressBar3->Value=proc_CPU;

 
}
};
}



Brak komentarzy:

Prześlij komentarz