计算windows从启动后所运行的总时间.txt
来自「VB应用技巧 1.int文件的读写 2.如何取得计算机名 3.计算Wind」· 文本 代码 · 共 17 行
TXT
17 行
利用Api函数计算Windows从启动后所运行的总时间
Private Declare Function GetTickCount Lib "kernel32" () As Long
Private Sub Timer1_Timer()
Dim hour As Integer
Dim minute As Integer
Dim second As Integer
hour = GetTickCount \ 1000 \ 60 \ 60
Label1.Caption = Str(hour) + "小时"
minute = (GetTickCount - hour * 60 * 60 * 1000) \ 1000 \ 60
Label2.Caption = Str(minute) + "分钟"
second = (GetTickCount - Val(Label1.Caption) * 60 * 60 * 1000 - Val(Label2.Caption) * 60 * 1000) \ 1000
Label3.Caption = Str(second) + "秒钟"
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?