VB.NET Programming
[VBNET] PC 사용 시간 얻어 오기 (PC Use Time)
ZerosKD
2020. 4. 23. 11:41
반응형
*C# PC 사용 시간 얻어 오기 예제...
- 사용한 컨트롤 : Button 1개, Label 1개
전체 소스 코드
From1.cs
Public Class Form1
Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button1.Click
Try
Using pc As PerformanceCounter = New PerformanceCounter("System", "System Up Time")
pc.NextValue()
label1.Text = TimeSpan.FromSeconds(pc.NextValue()).ToString()
End Using
Catch ex As Exception
label1.Text = "00:00:00"
End Try
End Sub
End Class
*예제 결과
https://kdsoft-zeros.tistory.com/194
반응형