如何用API更改当前的系统时间?(40分)

  • 主题发起人 主题发起人 rockxu
  • 开始时间 开始时间
R

rockxu

Unregistered / Unconfirmed
GUEST, unregistred user!
同上,谢谢!
 
SetLocalTime()
 
procedure DateTimeToSystemTime(DateTime: TDateTime; var SystemTime: TSystemTime);<br><br>
 
procedure TForm1.FormCreate(Sender: TObject);<br>var<br>&nbsp; MyST:TSystemTime;<br>begin<br>&nbsp; with MyST do<br>&nbsp; begin<br>&nbsp; &nbsp; wYear:=1999;<br>&nbsp; &nbsp; wMonth:=12;<br>&nbsp; &nbsp; wDay:=20;<br>&nbsp; &nbsp; wHour:=8;//此时间是相对的。<br>&nbsp; &nbsp; wMinute:=9;<br>&nbsp; &nbsp; wSencond:10;<br>&nbsp; end;<br><br>&nbsp; if SetlocalTime(MyST) then<br>&nbsp; &nbsp; showmessage('success')<br>&nbsp; else<br>&nbsp; &nbsp; showmessage('false');<br>end;<br><br>不明白参数的地方,请查考msdn或delphi的api帮助。
 
接受答案了.
 
后退
顶部