共用方式為


WebSocket.ThrowOnInvalidState(WebSocketState, WebSocketState[]) 方法

定義

確認連接處於預期的狀態。

protected:
 static void ThrowOnInvalidState(System::Net::WebSockets::WebSocketState state, ... cli::array <System::Net::WebSockets::WebSocketState> ^ validStates);
protected static void ThrowOnInvalidState (System.Net.WebSockets.WebSocketState state, params System.Net.WebSockets.WebSocketState[] validStates);
static member ThrowOnInvalidState : System.Net.WebSockets.WebSocketState * System.Net.WebSockets.WebSocketState[] -> unit
Protected Shared Sub ThrowOnInvalidState (state As WebSocketState, ParamArray validStates As WebSocketState())

參數

state
WebSocketState

要根據有效狀態清單測試的 WebSocket 目前狀態。

validStates
WebSocketState[]

有效連接狀態的清單。

適用於