函数参考


_WinAPI_PathIsContentType

Determines if a file's registered content type matches the specified content type.

#Include <WinAPIEx.au3>
_WinAPI_PathIsContentType ( $sPath, $sType )

参数

$sPath The file whose content type will be compared.
$sType The content type string. For example, "application/x-msdownload", "image/jpeg", "text/plain", etc.

返回值

Success 1 - The file's content type matches the specified content type.
0 Otherwise.
失败: 返回 0 并设置 @error 标志为非 0 值.

注意/说明

None

相关

详情参考

在MSDN中搜索


示例/演示


#Include <Array.au3>
#Include <File.au3>
#Include <WinAPIEx.au3>

Opt('MustDeclareVars', 1)

Global $FileList = _FileListToArray(@SystemDir, '*.*', 1)
Global $SortList[UBound($FileList) - 1]
Global $Count = 0

For $i = 1 To $FileList[0]
    If _WinAPI_PathIsContentType($FileList[$i], 'text/xml') Then
        $SortList[$Count] = $FileList[$i]
        $Count += 1
    EndIf
Next
If $Count Then
    ReDim $SortList[$Count]
Else
    Exit
EndIf

_ArrayDisplay($SortList, '_WinAPI_PathIsContentType')