怎么处理buffer数组转Ascii编码,取自己想要的数据“00000116”

本文介绍了如何使用C#处理从串口接收到的Buffer数组,将其转换为ASCII编码,并从中提取特定数据,例如'00000116'。通过示例代码展示了如何在Windows Forms应用程序中实现这一过程。
摘要由CSDN通过智能技术生成

// 00 00 01 16是想要的数据(https://img-
![软件接收的效果](https://img-blog.csdnimg.cn/2019042519524116.jpeg?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzM4NDg2NzAx,size_16,color_FFFFFF,t_70)
blog.csdnimg.cn/20190425194928979.jpeg)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.IO ;
using System.IO.Ports;
using System.Text;
using System.Windows.Forms;
using System.Timers;
//using System.Reflection;
//using System.Resources;
//using System.Runtime;
using System.Threading;
using Microsoft.Win32;

namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{

        InitializeComponent();
        serialPort1.DataReceived += new SerialDataReceivedEventHandler(port_DataReceived);//port_DataReceived

        System.Windows.Forms.Control.CheckForIlleg
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值