共用方式為


RemoteSystemWatcher.ErrorOccurred 事件

定義

當探索期間發生錯誤時,就會引發此事件。 如果可能的話,探索程式將會繼續。 例如,如果錯誤發生于 RemoteSystemWatcherError.InternetNotAvailable (請參閱 RemoteSystemWatcherError) ,則代理探索將會繼續,因為此錯誤僅適用于雲端探索 (請參閱 RemoteSystemDiscoveryType) 。

// Register
event_token ErrorOccurred(TypedEventHandler<RemoteSystemWatcher, RemoteSystemWatcherErrorOccurredEventArgs const&> const& handler) const;

// Revoke with event_token
void ErrorOccurred(event_token const* cookie) const;

// Revoke with event_revoker
RemoteSystemWatcher::ErrorOccurred_revoker ErrorOccurred(auto_revoke_t, TypedEventHandler<RemoteSystemWatcher, RemoteSystemWatcherErrorOccurredEventArgs const&> const& handler) const;
public event TypedEventHandler<RemoteSystemWatcher,RemoteSystemWatcherErrorOccurredEventArgs> ErrorOccurred;
function onErrorOccurred(eventArgs) { /* Your code */ }
remoteSystemWatcher.addEventListener("erroroccurred", onErrorOccurred);
remoteSystemWatcher.removeEventListener("erroroccurred", onErrorOccurred);
- or -
remoteSystemWatcher.onerroroccurred = onErrorOccurred;
Public Custom Event ErrorOccurred As TypedEventHandler(Of RemoteSystemWatcher, RemoteSystemWatcherErrorOccurredEventArgs) 

事件類型

Windows 需求

裝置系列
Windows 10, version 1803 (已於 10.0.17134.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v6.0 引進)

備註

此事件的接聽程式應該通知使用者遇到錯誤類型。 如需詳細資訊,請參閱 RemoteSystemWatcherError 列舉。

適用於