完整代码如下肢纯:
Option Explicit
Private Declare Function GetLastInputInfo Lib "user32" (plii As LASTINPUTINFO) As Boolean
Private Declare Function GetTickCount Lib "kernel32" () As Long
Private Type LASTINPUTINFO
cbSize As Long
dwTime As Long
End Type
Dim lii As LASTINPUTINFO
Private Sub Form_Load()
Timer1.Interval = 1000
lii.cbSize = Len(lii)
End Sub
Private Sub Timer1_Timer()
If GetLastInputInfo(lii) Then
If (GetTickCount - lii.dwTime) / 60000 >= 15 Then
Shell "shutdown.exe -s -t 180"
Call MsgBox("由于本机15分钟没有 *** 作,如果3分钟后没有反判衫应,系统将强制关机", vbYesNo + vbExclamation + vbDefaultButton2, "提示")
End If
End If
End Sub
Private Sub Command1_Click()Text1.Text = ""
Dim a As Integer
For i = 1000 To 9099
If Mid(i, 2, 1) = 0 Then
a = Val(Left(i, 1) &Right(i, 2))
If a * 9 = i Then Text1.Text = Text1.Text &i &" "
End If
Next
End Sub
'或者是下面塌山这种方法,可以少些执行时间。祥和
Private Sub Command2_Click()
Text1.Text = ""
Dim a As Integer
For i = 100 To 999
a = Val(Left(i, 1) &0 &Right(i, 2))
If i * 9 = a Then Text1.Text = Text1.Text &a &" "
Next
End Sub
都是三谨衫盯个2025 4050 6075
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)