port1.ReadExisting()错误 [英] port1.ReadExisting() Error

查看:103
本文介绍了port1.ReadExisting()错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要读取RFID标签并通过comport将该值获取到我的C#表单,在这里我分配了一个名为s的字符串来从port1.ReadExisting()读取数据.

像这样---> s + = port1.ReadExisting();和textbox1.text = s;

在这种情况下,它将给出一个错误,即跨线程操作无效:控件"textBox1"是从创建该线程的线程之外的线程访问的."

请对此问题提出建议

I need to read RFID tag and get the value through the comport to the my C# form , here i assign string called s to get readings from port1.ReadExisting();

like this --- > s += port1.ReadExisting(); and textbox1.text = s;

In this case it will give a error called " Cross-thread operation not valid: Control ''textBox1'' accessed from a thread other than the thread it was created on."

please give a suggestion to this matter

推荐答案

请参阅此处[
See here [^].
:)


这篇关于port1.ReadExisting()错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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