不久前写的修改系统时间-源码+工具
源码:
'模块****************************************************
Declare Function SetSystemTime Lib "kernel32" (lpSystemTime As SYSTEMTIME) As Long
Type SYSTEMTIME ' 16 Bytes
wYear As Integer
wMonth As Integer
wDayOfWeek As Integer
wDay As Integer
wHour As Integer
wMinute As Integer
wSecond As Integer
wMilliseconds As Integer
End Type
Public Function SetTime(ByVal sYear As Integer, _
ByVal sMonth As Integer, _
ByVal sDayW As Integer, _
ByVal sDay As Integer, _
ByVal sHour As Integer, _
ByVal sMin As Integer, _
ByVal sSecond As Integer, _
ByVal sMill As Integer) As Long
Dim Syst As SYSTEMTIME
If sHour < 8 Then '时区不同需要修改
sHour = sHour + 16
ElseIf sHour > 8 Then
sHour = sHour - 8
End If
With Syst
.wYear = sYear
.wMonth = sMonth
.wDayOfWeek = sDayW
.wDay = sDay
.wHour = sHour
.wMinute = sMin
.wSecond = sSecond
.wMilliseconds = sMill
End With
SetSystemTime Syst
End Function
'窗体模块***********************************************************
Private Sub Command1_Click()
Dim a As Long
Dim St(5) As Integer
For i = 0 To 5
St(i) = Val(Form1.Text1(i))
Next
a = SetTime(St(0), St(1), 0, St(2), St(3), St(4), St(5), 0)
'年,月,0,日,时,分钟,秒,0
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Form_Load()
Text1(0) = Left(Now, 4)
Text1(1) = Val(Mid(Date, 6, 7))
Text1(2) = Val(Mid(Date, 9, 10))
Text1(3) = Hour(Time)
Text1(4) = Minute(Time)
Text1(5) = Second(Time)
End Sub
Private Sub Label7_Click()
Shell "explorer [url]http://www.[/url]"
End Sub