<StructLayout(LayoutKind.Sequential)> _
Public Structure SYSTEMTIME
Public wYear As Short
Public wMonth As Short
Public wDayOfWeek As Short
Public wDay As Short
Public wHour As Short
Public wMinute As Short
Public wSecond As Short
Public wMilliseconds As Short
End Structure
Private Declare Function SetSystemTime Lib "kernel32" (ByRef
lpSystemTime As SYSTEMTIME) As Integer
Private Declare Sub GetSystemTime Lib "kernel32" Alias "GetSystemTime"
(ByRef lpSystemTime As SYSTEMTIME)
Usage (SetSystemTime):
Dim st As SYSTEMTIME
With st
.wDay = 14
.wMonth = 12
.wYear = 2008
.wMinute = 1
.wHour = 1
.wSecond = 0
End With
If SetSystemTime(st) = 1 Then
MessageBox.Show("System Time Changed")
Else
MessageBox.Show(Marshal.GetLastWin32Error.ToString)
End If
Usage (GetSystemTime):
Dim sysTime As SYSTEMTIME
GetSystemTime(sysTime)
MessageBox.Show(sysTime.wHour.ToString())
Aramaya inanın...
Yalçın