Ở bài viết này mình giới thiệu đến các bạn đối tượng PerformanceCounter, ProgressBar. Sau khi bạn thiết kế form như trên bạn thêm 2 đối tượng PerformanceCounter1, PerformanceCounter2, Timer1.
- Bước tiếp theo bạn mở Properties của PerformanceCounter1 bạn điều chỉnh thuộc tính sau:
- CatalogName = Processor
- CounterName = % Processor Time
- InstanceName = _Total
- CatalogName = Memory
- CounterName = % Committed Bytes In Use
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick ProgressBar1.Value = PerformanceCounter1.NextValue ProgressBar2.Value = PerformanceCounter2.NextValue Label4.Text = ProgressBar1.Value & " %" Label3.Text = ProgressBar2.Value & " %" Label9.Text = My.Computer.Name Label10.Text = My.User.Name Label11.Text = My.Computer.Info.OSFullName Label12.Text = My.Computer.Clock.LocalTime End Sub
Chúc mọi người thành công với thủ thuật trên để kiểm tra máy tính xem đủ hiệu suất sữ dụng không nhé.
Theo LapTrinhVB.Net
2 comments:
tuỳ biến khá đó e
Code này mấy bữa a chia sẽ r mà
Post a Comment