Funktionreferenz


_WinAPI_PathIsContentType

Beschreibung anzeigen in

Ermittelt, ob der registrierte Inhaltstyp einer Datei mit dem angegebenen Inhaltstyp übereinstimmt

#include <WinAPIShPath.au3>
_WinAPI_PathIsContentType ( $sFilePath, $sType )

Parameter

$sFilePath Die Datei, deren Inhaltstyp verglichen werden soll.
$sType Der String für den Inhaltstyp. Zum Beispiel "application/x-msdownload", "image/jpeg", "text/plain", usw.

Rückgabewert

True: der Inhaltstyp der Datei mit dem angegebenen Inhaltstyp übereinstimmt.
False: der Inhaltstyp der Datei nicht übereinstimmt.

Siehe auch

Suche nach PathIsContentType in der MSDN Bibliothek.

Beispiel

#include <Array.au3>
#include <File.au3>
#include <WinAPIShPath.au3>

_Example()
Func _Example()
    Local $aFileList = _FileListToArray(@SystemDir, '*.*', 1)
    Local $aSortList[UBound($aFileList) - 1]
    Local $iCount = 0

    For $i = 1 To $aFileList[0]
        If _WinAPI_PathIsContentType($aFileList[$i], 'text/xml') Then
            $aSortList[$iCount] = $aFileList[$i]
            $iCount += 1
        EndIf
    Next
    If $iCount Then
        ReDim $aSortList[$iCount]
        _ArrayDisplay($aSortList, '_WinAPI_PathIsContentType')
    EndIf
EndFunc   ;==>_Example