Media.getAttributeCountByType 方法

[与此页面关联的功能(Windows 媒体播放器 SDK)是旧版功能。 它已被 MediaPlayer 取代。 MediaPlayer 已针对Windows 10和Windows 11进行了优化。 Microsoft 强烈建议新代码尽可能使用 MediaPlayer 而不是 Windows 媒体播放器 SDK。 如果可能,Microsoft 建议重写使用旧 API 的现有代码以使用新 API。]

getAttributeCountByType 方法检索与指定属性名称和语言关联的属性数。

语法

retVal = Media.getAttributeCountByType(
  name,
  language
)

参数

name [in]

包含属性名称的字符串。 有关 Windows 媒体播放器 支持的属性的信息,请参阅 Windows 媒体播放器 属性参考

language [in]

表示语言的字符串。 如果值设置为 null 或“” (空字符串) ,则使用当前区域设置字符串。 否则,该值必须是有效的 RFC 1766 语言字符串,例如“en-us”。

返回值

此方法返回包含属性计数的长) number (

备注

此方法用于确定与给定 Media 对象的特定属性名称对应的属性数。 然后,可以将索引号传递给 getItemInfoByType 方法。 例如,当媒体项目被归类为多个流派时,这很有用。

若要使用此方法,需要对库的读取访问权限。 有关详细信息,请参阅 库访问

Windows 媒体播放器 10 移动版:此属性始终返回 0。

要求

要求
版本
Windows Media Player 9 系列或更高版本。
DLL
Wmp.dll

另请参阅

MediaObject

Media.getItemInfoByType

Settings.mediaAccessRights

Settings.requestMediaAccessRights