到Console.ReadLine() [英] console.ReadLine()
问题描述
我为一个有趣的聊天服务器提供了多个线程。
当我做控制台时。 ReadLine()和另一个线程执行console.WriteLine()它"break" console.readline()部分。我可以替换它吗?
我正在考虑为服务器制作一个表格,但我不知道是否有必要..
顺便说一句,有人知道你是否可以在完成空白时使用〜来执行某个函数?
像void command(){
我在这里做的事情
}
~command(){
Console.WriteLine(" command void done!");
}
Hi, i got multiple threads for a chat server i been working on for fun.
When i do Console.ReadLine() and a another thread does console.WriteLine() it "breaks" the console.readline() part. Anything i can replace it with?
I was thinking of making a Form for the server but i dont know if that is necessary..
By the way, does anyone know if you can use the ~ for a function when a void is done?
like void command(){
I do stuff here
}
~ command(){
Console.WriteLine("command void done!");
}
这篇关于到Console.ReadLine()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!