ErrorItem.errorCode

[與此頁面相關聯的功能Windows 媒體播放機 SDK是舊版功能。 它已被 MediaPlayer 取代MediaPlayer已針對Windows 10和Windows 11進行優化。 Microsoft 強烈建議新程式碼盡可能使用MediaPlayer,而不是Windows 媒體播放機 SDK。 Microsoft 建議盡可能重寫使用舊版 API 的現有程式碼,以使用新的 API。]

errorCode屬性會擷取目前的錯誤碼。

player.error.item(
        index
        ).errorCode

可能的值

此屬性是唯讀 的 Number (long) 。

備註

您應該設定 [ 設定]。如果您選擇顯示自訂錯誤訊息,enableErrorDialogs 為 false。

範例

下列 JScript 範例使用 ErrorItemerrorCode 在事件處理常式中向使用者顯示錯誤碼。 Player物件是以 ID = 「Player」 建立。

<SCRIPT LANGUAGE = "JScript"  FOR = Player  EVENT = error()>

// Get the error code for the first error item.
errNum = Player.error.item(0).errorCode;

// Display the error information.
var message = "Error number: " + errNum);
message += "<BR>";
message += "Use your BACK button to return ";
message += "to the previous page.";
document.write(message);

</SCRIPT>

規格需求

需求
版本
Windows 媒體播放機 7.0 版或更新版本。
DLL
Wmp.dll

另請參閱

ErrorItem 物件

ErrorItem.errorDescription