Durchsucht einen String unter Verwendung eines Microsoft MS-DOS-Platzhalters
#include <WinAPIShPath.au3>
_WinAPI_PathMatchSpec ( $sFilePath, $sSpec )
| $sFilePath | Der zu durchsuchende Pfad. |
| $sSpec | Der Dateityp, nach dem gesucht werden soll. Um zum Beispiel zu prüfen, ob $sFilePath eine .doc-Datei ist, sollte $sSpec auf "*.doc" gesetzt werden. |
| Erfolg: | True - Der String passt. |
| Fehler: | False. |
Suche nach PathMatchSpec in der MSDN Bibliothek.
#include <Array.au3>
#include <File.au3>
#include <WinAPIShPath.au3>
_Example()
Func _Example()
Local $aFileList = _FileListToArray(@SystemDir, '*.dll', 1)
Local $aSortList[UBound($aFileList) - 1]
Local $iCount = 0
For $i = 1 To $aFileList[0]
If _WinAPI_PathMatchSpec($aFileList[$i], 'net*.dll') Then
$aSortList[$iCount] = $aFileList[$i]
$iCount += 1
EndIf
Next
If $iCount Then
ReDim $aSortList[$iCount]
Else
Exit
EndIf
_ArrayDisplay($aSortList, '_WinAPI_PathMatchSpec')
EndFunc ;==>_Example