我有一个小问题。APIFindNextFile
不会列出目录的全部内容C:\Windows\System32
(仅限 Windows 7)。任何人有任何解决方案?
代码[德尔福]:
Var
sAtr: String;
sPathName: String;
I: Integer;
iCont: Integer;
tHnd: THandle;
tArrAtr: TStringList;
tWDF: WIN32_FIND_DATA;
Begin
iCont := 0;
sAtr := '';
Result := TStringList.Create;
tArrAtr := TStringList.Create;
tHnd := FindFirstFile(PChar(sPath + '*.*'), tWDF);
If RightStr(sPath, 1) <> '\' Then
sPath := sPath + '\';
If tHnd = INVALID_HANDLE_VALUE Then
Exit;
Repeat
If (tWDF.dwFileAttributes And FILE_ATTRIBUTE_ARCHIVE) > 0 Then
If (String(tWDF.cFileName[0]) <> '.') Then
Begin
sPathName := sPath + String(tWDF.cFileName);
Result.Add(String(tWDF.cFileName) + sDel +
GetFileSizeAPI(sPathName));
sAtr := '';
Inc(iCont);
End;
Until (FindNextFile(tHnd, tWDF) <> True);
//CloseHandle(tHnd);