C#中 行数问题 不知道是什么原因

图片说明
我想看框2的行数,为什么一开始就是2
图片说明
明明最后只有5行,但是显示6 。。。
代码如下:
private void button2_Click(object sender, EventArgs e)
{
OpenFileDialog fileName = new OpenFileDialog();
fileName.InitialDirectory = "D:\Users\zwj\Desktop\调试工具";
fileName.Filter = "All files (*.*)|*.*|* files (*.*)|*.*";
fileName.FilterIndex = 2;
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
richTextBox1.LoadFile(openFileDialog1.FileName,
RichTextBoxStreamType.PlainText);
}
}
private void button1_Click(object sender, EventArgs e)
{
string str = richTextBox1.Text;
string[] lines = str.Split(Environment.NewLine.ToCharArray());
for (int i = 1; i < lines.Length; i++)
{
Console.WriteLine(lines[i]);
string[] linecell = lines[i].Split(new char[] { ',' });

            if (linecell.Length > 2)
            {
                richTextBox2.Text = richTextBox2.Text  + linecell[2]+ "\r\n";//读取出身份证号码   
            }
            MessageBox.Show(richTextBox2.Lines.Count().ToString());
        }
      }

是因为多了回车换行符吗?该怎么去掉他

你的代码自动增加了\r\n在后面,肯定会形成新行了,盖下面的

            if (linecell.Length > 2)
            {
                richTextBox2.Text = richTextBox2.Text  +( richTextBox2.Text==""?"": "\r\n")+ linecell[2];//读取出身份证号码   
            }

其实真正要实现的是

if (linecell.Length > 2)
{
richTextBox2.Text = richTextBox2.Text + linecell[2]+ "\r\n";//读取出身份证号码

string aaa = AES.AESEncrypt(linecell[2]);
richTextBox2.Text += aaa +"\r\n"; //对身份证号码进行加密

}
MessageBox.Show(richTextBox2.Lines.Count().ToString());
}
}

图片说明
这是我的现在的代码

图片说明
虽然这里行数对了 ,但是第一行这里没了换行。。。

if (linecell.Length > 2)
{
richTextBox2.Text = richTextBox2.Text +( richTextBox2.Text==""?"": "\r\n")+ linecell[2];//读取出身份证号码

}