【文件属性】:
文件名称:Delphi 简单获取Windows时间的例子.rar
文件大小:6KB
文件格式:RAR
更新时间:2022-07-30 11:00:48
Delphi源码-系统相关
简单获取Windows时间-Delphi源代码,改时间的小程序,在Windows自带的时间管理中也可完成系统时间的修改,这个只是一个帮助了解Windows与Delphi编程的例子,如何通过Delphi的程序来修改Windows时间,大致就是这样实现的。可参见以下源码:
procedure TForm1.Button1Click(Sender: TObject);
var
Dtimer : TSystemTime;
hh,Ghh : Integer;
begin
hh := StrToInt(Trim(Edit4.Text));
if hh < 8 then
Ghh := 16 hh
else
Ghh := hh - 8;
with Dtimer do
begin
wYear:=StrToInt(Edit1.Text);
wMonth:=StrToInt(Edit2.Text);
wDay:=StrToInt(Edit3.Text);
wHour:=Ghh;
wMinute:=StrToInt(Edit5.Text);
wSecond:=StrToInt(Edit6.Text);
end;
SetSystemTime(Dtimer);
end;
【文件预览】:
srcfans.com
----time()
--------Project1.res(876B)
--------Unit1.dfm(2KB)
--------Unit1.ddp(51B)
--------Project1.cfg(434B)
--------Unit1.pas(1KB)
--------Project1.dpr(188B)
--------Project1.dof(2KB)
--------Unit1.dcu(4KB)