共用方式為


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 的狀態快取索引鍵。

例外狀況

storagecontextServiceKeynull

備註

此建構函式會建立狀態管理物件和相關聯的範圍。 物件會使用 storage 來保存狀態屬性值。 物件會使用 contextServiceKey 在每個回合的內容中快取狀態。

適用於

另請參閱