Forum: Win32/Win64 API (native code)
Delphi
by Nogge,
13. Mai 2005
Wer sucht, der findet: datei erstellungsdatum
Dann einfach die Function so z.B. benutzen:
procedure TForm1.Button1Click(Sender: TObject);
var ayear,amonth,aday,ahour,amin,asec,amsec:word;
begin
DecodeDate(GetCreationTimeOfFile(Edit1.Text),ayear,amonth,aday);
DecodeTime(GetCreationTimeOfFile(Edit1.Text),ahour,amin,asec,amsec);
label1.Caption:=inttostr(ayear)+' '+inttostr(amonth)+'...
Forum: Win32/Win64 API (native code)
Delphi
by Nogge,
12. Mai 2005
Ich verstehe deine Frage nicht so ganz. Meinste jetzt das Erstellungsdatum der Datei oder die wirkliche Uhrzeit? Abgesehen davon ist beides möglich, um deine Frage einfach mal ganz simpel zu beanworten^^
Forum: Win32/Win64 API (native code)
Delphi
by Nogge,
5. Apr 2005
kk, für das bisschen braucht man auch keine neue Klasse:
function StrCharCount(const S: AnsiString; C: AnsiChar): Integer;
var
I: Integer;
begin
Result := 0;
for I := 1 to Length(S) do
if S = C then
Inc(Result);
Forum: Win32/Win64 API (native code)
Delphi
by Nogge,
5. Apr 2005
lol, beim nächsten Mal analysiere ich meinen Code genauer^^
DelTree benötigt die Uses "JclFileUtils". Ich hoffe, du hast JCL.
Forum: Win32/Win64 API (native code)
Delphi
by Nogge,
5. Apr 2005
Ja, das ist auch noch ne Function von mir...sry, dass ich die vergessen habe:
Function GetOnlyFolderName(Dir: String; PathFolders: Cardinal = 1; SlashAtBack: Boolean = false): String;
var INDEXslash: Integer; BSlash_Count:Cardinal;
begin
if AnsiLastChar(Dir)^ = '\' then delete(Dir,Length(Dir),1);
BSlash_Count:=StrCharCount(Dir,'\'); //JclStrings
while BSlash_Count>PathFolders do
...
Forum: Win32/Win64 API (native code)
Delphi
by Nogge,
5. Apr 2005
Ich hatte mir mal eine eigene Procedure geschrieben, die bisher bei mir immer funktioniert hat:
Procedure CopyDir(DirPath,NewPath: String; Cut:Boolean);
Procedure FindDirs(DirPath: String; StringList:TStrings; Recurse: Boolean = false);
var SR:TSearchRec;
begin
if AnsiLastChar(DirPath)^ <> '\'
then DirPath:=DirPath + '\';
// Ordner suchen
try