Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/276.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何将来自用户的消息存储在变量中?(Microsoft Bot框架)_C#_Botframework_Bots_Chatbot - Fatal编程技术网

C# 如何将来自用户的消息存储在变量中?(Microsoft Bot框架)

C# 如何将来自用户的消息存储在变量中?(Microsoft Bot框架),c#,botframework,bots,chatbot,C#,Botframework,Bots,Chatbot,我正在基于MS bot框架为我的bot开发反馈功能。因此,我想使用Azure表存储来存储反馈。除了一点之外,一切正常: 此时,当用户向bot发送反馈时,表插入过程开始。但不是插入来自用户的消息,而是将名为“moin”的占位符插入到表存储中 // Schlüssel für den Table-Zugriff string accountKey = "myKey"; string accountName = &qu

我正在基于MS bot框架为我的bot开发反馈功能。因此,我想使用Azure表存储来存储反馈。除了一点之外,一切正常:

此时,当用户向bot发送反馈时,表插入过程开始。但不是插入来自用户的消息,而是将名为“moin”的占位符插入到表存储中

// Schlüssel für den Table-Zugriff
                string accountKey = "myKey";
                string accountName = "myStorageAccountName";

                // Schlüssel werden hier für den Table-Eintrag zusammengepackt
                TableQueries tableQueries = new TableQueries
                {
                    accountKey = accountKey,
                    accountName = accountName
                };

                // Werte für den Table-Eintrag
                string rowKey = "1";
                string partitionKey = rowKey;
                string userStatement = "moin";

                // Methode für den Table-Eintrag wird hier ausgeführt
                Task<Boolean> bLinkCreated = tableQueries.InsertURL(partitionKey, rowKey, userStatement);
                bLinkCreated.Wait();

                // Wird ausgeführt, wenn keine KnowledgeBase gefunden wird
                System.Diagnostics.Debug.WriteLine("sending feedback");
                await turnContext.SendActivityAsync(MessageFactory.Text("Thanks for sending the feedback!"), cancellationToken);
                break;
//Schlüssel für den Table Zugriff
字符串accountKey=“myKey”;
字符串accountName=“myStorageAccountName”;
//施吕塞尔·韦尔登(Schlüssel werden hier für den Table Eintrag zusammengepackt)
TableQueries TableQueries=新建TableQueries
{
accountKey=accountKey,
accountName=accountName
};
//韦特·弗尔登餐桌酒店
字符串rowKey=“1”;
string partitionKey=rowKey;
字符串userStatement=“moin”;
//方法:将表中的数据以ausgeführt的形式显示出来
Task bLinkCreated=tableQueries.InsertURL(partitionKey、rowKey、userStatement);
Wait();
//沃德·奥斯盖夫特,温·基恩知识库·格芬登·沃德
System.Diagnostics.Debug.WriteLine(“发送反馈”);
Wait turnContext.SendActivityAsync(MessageFactory.Text(“感谢发送反馈!”)、cancellationToken);
打破
如何用用户发送的消息替换当前占位符?
是否有方法/函数提取用户消息,然后用my userStatement变量替换它?

假设您的turncontext是
iTunesContext turncontext
。然后您可以在
turnContext.Activity.Text

string userStatement = turnContext.Activity.Text;

请将您的代码作为文本而不是图像发布。@itsme86 ups忘记了这一点-谢谢您向我指出这一点