语言

UserState.GetStorageKey(ITurnContext) 方法

定义

获取在存储和从存储读取和写入状态时要使用的密钥。

protected override string GetStorageKey(Microsoft.Bot.Builder.ITurnContext turnContext);
override this.GetStorageKey : Microsoft.Bot.Builder.ITurnContext -> string
Protected Overrides Function GetStorageKey (turnContext As ITurnContext) As String

参数

turnContext
ITurnContext

此轮次的上下文对象。

返回

存储密钥。

例外

当前回合的 是 Activity 缺少 ChannelId 信息 From ,或者 Id 发送方的 信息缺失。

注解

用户状态将频道ID和用户ID作为存储密钥的一部分。

适用于