語言

BotState(IStorage, String) 建構函式

定義

初始化 BotState 類別的新執行個體。

public BotState(Microsoft.Bot.Builder.IStorage storage, string contextServiceKey);
new Microsoft.Bot.Builder.BotState : Microsoft.Bot.Builder.IStorage * string -> Microsoft.Bot.Builder.BotState
Public Sub New (storage As IStorage, contextServiceKey As String)

參數

storage
IStorage

這個狀態管理物件會用來儲存和檢索狀態的儲存層。

contextServiceKey
String

此狀態快取 BotState的金鑰。

例外狀況

storage 或 contextServiceKey 為 null。

備註

此建構函式會建立狀態管理對象和相關聯的範圍。 物件使用 storage 以持久化狀態屬性值。 物件在上下文中每回合使用 contextServiceKey to cache 狀態。

適用於

另請參閱