UDF > WinAPIEx > ShellPath >


_WinAPI_PathIsContentType

Détermine si le type de contenu enregistré d'un fichier correspond au type de contenu spécifié

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

Paramètres

$sFilePath Le fichier dont le type de contenu sera comparé.
$sType La chaîne du type de contenu. Par exemple, "application/x-msdownload ", "image/jpeg", "text/plain", etc.

Valeur de retour

True: Le type de contenu du fichier correspond au type de contenu spécifié.
False: Le type de contenu du fichier ne correspond pas.

Voir aussi

Consultez PathIsContentType dans la librairie MSDN.

Exemple

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

_Example()

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

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