c# 16进制显示转化
2024-10-05 23:11:19
非原创。
接收16进制数据,在TextBox委托显示:
private void readPortandShow()
{
char[] HexChar = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
byte receivebyte = (byte)serialPort1.ReadByte();
char hexH = HexChar[receivebyte / 16];
char hexL = HexChar[receivebyte % 16];
this.tBox.Invoke(new MethodInvoker(delegate
{
this.tBox.AppendText(hexH.ToString() + hexL.ToString() + " ");
}));
}
最新文章
- KeyedPriorityQueue
- [原创] Easy SysLite V1.2 (2016.5.29更新,新增加WIN10支持,一个程序适配所有系统减肥)
- Qt中通过ui怎么引用不了pushbutton呢? 原来是这样…
- Coin Test
- java排序集锦
- BrandZ:2016年全球最具价值品牌百强榜(完整报告)
- css3遇到的一些属性
- hadoop生态圈安装详解(hadoop+zookeeper+hbase+pig+hive)
- Swift - 使用UIDatePicker实现倒计时功能
- MongoDB执行计划分析详解
- Mac和Windows系统下Mysql数据库的导入导出
- CSS、常用标签属性
- ubuntu安装tensorboardx
- netframework webapi exceptionless
- turbo boost - 睿频加速
- Context namespace element 'annotation-config' and its parser class [org.springframework.context.annotation.AnnotationConfigBeanDefinitionParser] are only available on JDK 1.5 and higher
- 集成算法(chapter 7 - Hands on machine learning with scikit learn and tensorflow)
- android全屏
- MongoDB 3.0 Release Notes
- 【FJOI2014】最短路径树问题