0
나는 이미 많은 문자열을 입력하고 그 행 뒤에 텍스트를 열려고합니다. 새 행을 만들고 정보를 in.all 정보로 쓰려고합니다. 내가 쓰고 싶은 새로운 라인에 대한 은 내가기존 텍스트의 새 행에 새 문자열 추가
//button open file
private void button4_Click(object sender, EventArgs e)
{
if(openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
label7.Text = openFileDialog1.FileName;
textBox7.Text = File.ReadAllText(label7.Text);
}
}
//button save file
private void button5_Click(object sender, EventArgs e)
{
if (saveFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
File.WriteAllText(saveFileDialog1.FileName, textBox7.Text);
}
}
//this is the add button
private void button1_Click(object sender, EventArgs e)
{
string inValue1, inValue2, inValue3, inValue4, inValue5, inValue6;
inValue1 = textBox1.Text;
inValue2 = textBox2.Text;
inValue3 = textBox3.Text;
inValue4 = textBox4.Text;
inValue5 = textBox5.Text;
inValue6 = textBox6.Text;
string result = (inValue1 + "," + inValue2 + "," + inValue3 + ","
+inValue4+ "," +inValue5 + "," +inValue6);
//File.WriteAllText("C:\\text.txt", textBox1.Text);
System.IO.File.WriteAllText(@"C:\Users\v\Desktop\text.txt", result);
}