Jho*_*123 3 delphi winapi windows-7 delphi-xe3
我有一个小问题.API FindNextFile
不会列出目录的全部内容C:\Windows\System32
(仅限Windows 7).有人有任何解决方案?
代码[Delphi]:
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);
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
2280 次 |
最近记录: |