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 + "\r\n" + linecell[2]; } //讀取出身份證號碼
string aaa = AES.AESEncrypt(richTextBox2.Text);
richTextBox2.Text = aaa + "\r\n";
//對身份證號碼進行加密
}
}
其實string aaa = AES.AESEncrypt(richTextBox2.Text);應該是string aaa = AES.AESEncrypt(linecell[2]); 但是提示我其他信息: 索引超出了數組界限。
該怎麼改。。
你最後應該是 richTextBox2.Text = richTextBox2.Text + aaa + "\r\n";