在 C# 中通过串口发送 ctrl+C? [英] Sending ctrl+C over serial port in C#?

查看:104
本文介绍了在 C# 中通过串口发送 ctrl+C?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 C# 中通过串口发送我的设备 ctrl+c?

How can I send my device ctrl+c through serial port in C#?

推荐答案

串口不传输密钥.它们传输字节,通常是字符的 ASCII 表示.

Serial ports don't transmit keys. They transmit bytes, which are normally the ASCII representations of characters.

Keys.ControlKey & Keys.C"与感知 PC 上发生的事情有关键盘.但是串口并不传输键盘的整个状态.例如,F 键和箭头完全在 ASCII 之外系统.

"Keys.ControlKey & Keys.C" has to do with sensing what is going on on a PC keyboard. But serial ports do not transmit the whole state of the keyboard. For instance, the F keys and the arrows are entirely outside the ASCII system.

ASCII 图表会告诉你,例如,Ctrl-A 是 1,Ctrl-B 是 2,Ctrl-C 是 3,'A' 是 65,依此类推.

An ASCII chart will tell you that, for instance, Ctrl-A is 1, Ctrl-B is 2, Ctrl-C is 3, 'A' is 65, and so on.

这篇关于在 C# 中通过串口发送 ctrl+C?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆