private void UpdateProgressBar()
{
if (uploadprogress.Value == uploadprogress.Maximum) return;
try
{
var chr = (char)serialPort.ReadChar();
if (chr != '.')
{
textOutput.AppendText(chr.ToString());
uploadprogress.Value = uploadprogress.Maximum;
HideProgressBar();
return;
}
}
catch
{
return;
}
uploadprogress.Value++;
Application.DoEvents();
}