richtextbox에서 여러 항목을 변경하려고합니다. 나는 유일한 항목 먹으 렴 나는 또한에서는 StreamReader에서 루프에 당신의 방법을 생각서식있는 텍스트 상자에서 여러 항목 바꾸기
try
{
using (StreamReader reader = new StreamReader(path))
{
while (!reader.EndOfStream)
{
richTextBox1.AppendText(reader.ReadLine());
richTextBox1.Rtf = richTextBox1.Rtf.Replace(textBox1.Text, textBox2.Text);
richTextBox1.Rtf = richTextBox1.Rtf.Replace(textBox3.Text, textBox4.Text);
richTextBox1.Rtf = richTextBox1.Rtf.Replace(textBox5.Text, textBox6.Text);
}
}
// using (StreamWriter writer = new StreamWriter(path))
// {
// }
}
더 나은 설명하시기 바랍니다 . 첫 번째 추가에서는 스트림의 끝에 새로운 텍스트 줄을 추가합니다. 그런 다음 tb1의 모든 텍스트 값을 tb2 중 하나와 바꾸십시오. 이것도 가능합니까? 다른 사람들은 어때? –