Problem with serial port data receive in C#

前端 未结 6 1921
梦谈多话
梦谈多话 2021-01-15 21:40

I have a problem with a C# program. Through the Serial port i Receive a large string about 110 characters. This part works ok, but when i add code to split the string up i r

6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-15 21:56

    You should verify the length of your string before your start splitting it up. Put a conditional in there to handle the case where the string is less than what you expect, and then see if the errors persist.

提交回复
热议问题