简体   繁体   English

C#控制台应用程序控制台输入和侦听处理程序

[英]C# Console Application console Input and Listen to Handlers

I have a Skype for Business bot that is listening to a specific contact with handlers from the lync sdk. 我有一个Skype for Business机器人,该机器人正在监听与lync sdk中的处理程序的特定联系。 Now I want to input some commands through the console. 现在,我想通过控制台输入一些命令。 But when I use the ReadLine method my Bot only listen to the console and not to the skype handler from the conversation. 但是当我使用ReadLine方法时,我的Bot只听控制台,而不听对话中的Skype处理程序。 Is there a way to listen to both inputs? 有没有办法听两个输入?

Best regards 最好的祝福

Tobias 托比亚斯

Try run bot at new thread, like this: 尝试在新线程上运行bot,如下所示:

var bot = new MyBot();
new System.Threading.Tasks.Task(() => {
    bot.Start();
}).Start();
do {
    Console.ReadLine();//read command
} while (true);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM