3
3DDELPHI
Unregistered / Unconfirmed
GUEST, unregistred user!
各位好:
我有一个自定义过程Writeini如下:
procedure TForm1.WriteIni;
var
inifile:Tinifile;
CurrentTime:TSystemTime;
begin
try
inifile:=Tinifile.Create((extractfilepath(application.ExeName)+'watch.ini'));//在程序执行当前目录上创建watch.ini文件
SetFileAttributes(PChar(extractfilepath(application.ExeName)+'watch.ini'),FILE_ATTRIBUTE_NORMAL);//设置watch.ini文件属性为一般
GetLocalTime(CurrentTime);
with inifile do
begin
writeinteger('SysInfo','Year',CurrentTime.wYear );
writeinteger('SysInfo','Month',CurrentTime.wMonth );
writeinteger('SysInfo','Day',CurrentTime.wDay );
writeinteger('SysInfo','Hour',CurrentTime.wHour );
WriteInteger('SysInfo','Minute',CurrentTime.wMinute );
end;
finally
inifile.Free ;
end;
SetFileAttributes(PChar(extractfilepath(application.ExeName)+'watch.ini'),FILE_ATTRIBUTE_HIDDEN+ FILE_ATTRIBUTE_SYSTEM+FILE_ATTRIBUTE_READONLY);//设置watch.ini文件属性为系统、只读和隐藏
end;
此过程(writeini)在TForm1.FormCloseQuery事件句柄中执行,我先是在win2k+D5中调试成功后再编译成project1.exe文件,但在Win98下执行时所创建的Watch.ini的内容竟成了几个字母而已,如下:
QNQQQQQQTTTVVVWWWXXXYYYYYY
不知是何原因?请各位指教,多谢!!!
我有一个自定义过程Writeini如下:
procedure TForm1.WriteIni;
var
inifile:Tinifile;
CurrentTime:TSystemTime;
begin
try
inifile:=Tinifile.Create((extractfilepath(application.ExeName)+'watch.ini'));//在程序执行当前目录上创建watch.ini文件
SetFileAttributes(PChar(extractfilepath(application.ExeName)+'watch.ini'),FILE_ATTRIBUTE_NORMAL);//设置watch.ini文件属性为一般
GetLocalTime(CurrentTime);
with inifile do
begin
writeinteger('SysInfo','Year',CurrentTime.wYear );
writeinteger('SysInfo','Month',CurrentTime.wMonth );
writeinteger('SysInfo','Day',CurrentTime.wDay );
writeinteger('SysInfo','Hour',CurrentTime.wHour );
WriteInteger('SysInfo','Minute',CurrentTime.wMinute );
end;
finally
inifile.Free ;
end;
SetFileAttributes(PChar(extractfilepath(application.ExeName)+'watch.ini'),FILE_ATTRIBUTE_HIDDEN+ FILE_ATTRIBUTE_SYSTEM+FILE_ATTRIBUTE_READONLY);//设置watch.ini文件属性为系统、只读和隐藏
end;
此过程(writeini)在TForm1.FormCloseQuery事件句柄中执行,我先是在win2k+D5中调试成功后再编译成project1.exe文件,但在Win98下执行时所创建的Watch.ini的内容竟成了几个字母而已,如下:
QNQQQQQQTTTVVVWWWXXXYYYYYY
不知是何原因?请各位指教,多谢!!!