Citat:
borovac: Primjeri bi mi dobro došli. HVALA
Memorija (memory status ima jos poneku informaciju, pa pogledaj):
Code:
procedure TForm1.Button2Click(Sender: TObject);
var
status: MemoryStatus;
begin
GlobalMemoryStatus(status);
listbox2.Items.Clear;
listbox2.Items.Add('physical total: ' + inttostr(status.dwTotalPhys));
listbox2.Items.Add('physical avail: ' + inttostr(status.dwAvailPhys));
listbox2.Items.Add('pagefile total: ' + inttostr(status.dwTotalPageFile));
listbox2.Items.Add('pagefile avail: ' + inttostr(status.dwAvailPageFile));
listbox2.Items.Add('load %: ' + inttostr(status.dwMemoryLoad));
end;
FileSize, Time, etc:
Code:
procedure TForm1.Button1Click(Sender: TObject);
var
h: integer;
inf: BY_HANDLE_FILE_INFORMATION;
dt: TDateTime;
systime: TSystemTime;
tmptime: TFileTime;
begin
if OpenDialog1.Execute then
begin
h := FileOpen(OpenDialog1.FileName, fmOpenRead);
GetFileInformationByHandle(h, inf);
ListBox1.Items.Clear;
ListBox1.Items.Add('file size: ' + inttostr(inf.nFileSizeLow));
FileTimeToLocalFileTime(inf.ftCreationTime, tmptime);
FileTimeToSystemTime(tmptime, systime);
dt := SystemTimeToDateTime(systime);
ListBox1.Items.Add('created: ' + datetimetostr(dt));
FileTimeToLocalFileTime(inf.ftLastWriteTime, tmptime);
FileTimeToSystemTime(tmptime, systime);
dt := SystemTimeToDateTime(systime);
ListBox1.Items.Add('modified: ' + datetimetostr(dt));
FileTimeToLocalFileTime(inf.ftLastAccessTime, tmptime);
FileTimeToSystemTime(tmptime, systime);
dt := SystemTimeToDateTime(systime);
ListBox1.Items.Add('accessed: ' + datetimetostr(dt));
FileClose(h);
end;
nadam se da je ovo koristilo...
ss.
When something is hard to do, then it's not worth doing.