private void BtnEncode_Click(object sender, EventArgs e) { txtCorrData.Text = string.Empty; txtCorrParity.Text = string.Empty; if (txtInData.Text == string.Empty) { return; } byte[] encData = new byte[rsLen - parityLen]; parityData = new byte[parityLen]; for (int cnt = 0; cnt < txtInData.Text.Length; cnt++) { encData[cnt] = (byte)txtInData.Text[cnt]; } encData = objRS.Encode(encData); for (int cnt = 0; cnt < txtInData.Text.Length; cnt++) { txtErrData.Text += (char)encData[cnt]; } for (int cnt = rsLen - parityLen; cnt < rsLen; cnt++) { parityData[cnt - rsLen + parityLen] = encData[cnt]; txtErrParity.Text += encData[cnt].ToString("X2") + "h "; } }