티스토리 뷰

WPF

WPF C# Serial EOF Check

NicSub 2019. 6. 24. 20:38
728x90
반응형

String RF_text;
private void SetText(string text)
{
if (RF_ID.Dispatcher.CheckAccess())
{
RF_text = RF_text + text;
byte[] StrByte = Encoding.UTF8.GetBytes(text);
for (int i = 0; i < StrByte.Length; i++)
{
if (StrByte[i] == 0x03) //0x1A
{
RF_ID.Text = RF_text;
SendSerial(true);
RF_text = String.Empty;
break;
}
}
}
else
{
SetTextCallBack d = new SetTextCallBack(SetText);
RF_ID.Dispatcher.Invoke(d, new object[] { text });
}

    }
반응형

'WPF' 카테고리의 다른 글

WPF Textbox 항상 처음라인에 쓰기  (0) 2019.06.26
WPF Textbox 마지막라인 삭제  (0) 2019.06.26
Combobox 로딩중 selected event 금지  (0) 2019.05.14
WPF DataGrid empty row at bottom remove  (0) 2019.04.24
DataTable Sum Compute  (0) 2019.04.24
댓글