while (true)
{
if (Console.KeyAvailable)
{
ConsoleKeyInfo key = Console.ReadKey(true);
switch (key.Key)
{
case ConsoleKey.F1:
Console.WriteLine("You pressed F1!");
break;
default:
break;
}
}
// Do something more useful
}
C# 非阻塞监听键盘输入
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章
24-5-18 X
Higurashi-kagome
2024-06-01 14:30:43
【dubbo】如何测试一个dubbo服务呢?
金大鑫要堅持
2024-06-01 14:29:53
kubeconfig 多个集群配置 如何切换
kubectl config get-contexts kubectl config use-context <context-name> kubectl config current-context
hiningrise
2024-06-01 14:27:53
两台windowserver服务器配置Redis哨兵集群
天才臥龍
2024-06-01 14:24:12
oidc-client.js踩坑吐槽贴
提伯斯
2024-06-01 14:23:02
微盟电商-以造数工厂为底座的低成本自动化应用实现(一)
保軍Baojun
2024-06-01 14:20:12
Mac Brew install慢的问题
阿 軍
2024-06-01 14:18:02
Vue devDependencies 与 dependencies 能别
阿 軍
2024-06-01 14:18:02
mysql 超大大数据库复制前可执行的加速导入的SQL
菊花茶
2024-06-01 14:14:21
css25 CSS Tables
emanlee
2024-06-01 14:13:21
css29 CSS Layout - The z-index Property
emanlee
2024-06-01 14:13:21
css28 CSS Layout - The position Property
emanlee
2024-06-01 14:13:21
css26 CSS Layout - The display Property
emanlee
2024-06-01 14:13:21
css31 CSS Layout - float and clear
emanlee
2024-06-01 14:13:21