共用方式為


VpnChannel.ActivityStateChange 事件

定義

當通道的活動狀態變更時引發的事件。 VPN 外掛程式用來判斷通道是否在流量或閑置中。

// Register
event_token ActivityStateChange(TypedEventHandler<VpnChannel, VpnChannelActivityStateChangedArgs const&> const& handler) const;

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

// Revoke with event_revoker
VpnChannel::ActivityStateChange_revoker ActivityStateChange(auto_revoke_t, TypedEventHandler<VpnChannel, VpnChannelActivityStateChangedArgs const&> const& handler) const;
public event TypedEventHandler<VpnChannel,VpnChannelActivityStateChangedArgs> ActivityStateChange;
function onActivityStateChange(eventArgs) { /* Your code */ }
vpnChannel.addEventListener("activitystatechange", onActivityStateChange);
vpnChannel.removeEventListener("activitystatechange", onActivityStateChange);
- or -
vpnChannel.onactivitystatechange = onActivityStateChange;
Public Custom Event ActivityStateChange As TypedEventHandler(Of VpnChannel, VpnChannelActivityStateChangedArgs) 

事件類型

Windows 需求

應用程式功能
networkingVpnProvider

適用於