StringCollection.getItemInfoByType 方法

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

getItemInfoByType 方法检索与指定的 StringCollection 索引、名称、语言和属性索引对应的值。

语法

retVal = StringCollection.getItemInfoByType(
  index,
  name,
  language,
  attributeIndex
)

parameters

index [in]

number (long) 指定要从中获取特性的 StringCollection 项的从零开始的索引。

name [in]

包含属性名称的字符串

language [in]

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

attributeIndex [in]

Number () ,其中包含要从特性检索的值的从零开始的索引。

返回值

此方法返回 NumberStringMetadataPicture 对象或 MetadataText 对象,如下表所示。

Attribute 返回值
SyncState 数字 (无符号长)
WM/Lyrics_Synchronised MetadataText 对象
WM/Picture MetadataPicture 对象
WM/UserWebURL MetadataText 对象
所有其他特性 String

对于基础值为 Boolean 的属性,此方法返回字符串“true”或“false”。

备注

此方法支持具有多个值的属性和具有复杂值的属性。 getItemInfo 方法不支持具有多个或复杂值的属性。

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

要求

要求
版本
Windows 媒体播放器 11.
DLL
Wmp.dll

另请参阅

MetadataPicture 对象

MetadataText 对象

StringCollection.getItemInfo

StringCollection 对象