hi , sorry for disturb everyone , i just quite beginner in C# i have a question about save file function in textbox
here is frame picture:
Uploaded with ImageShack.us
here is my code but it is no completed code but i can success save one textbox in .txt file ~but i couldnt save two textbox" word" in txt file anyone got idea how to save the two textbox message in one txt file , after that i want to try read it,. now i tried to use write function into txt file .
here is frame picture:
Uploaded with ImageShack.us
here is my code but it is no completed code but i can success save one textbox in .txt file ~but i couldnt save two textbox" word" in txt file anyone got idea how to save the two textbox message in one txt file , after that i want to try read it,. now i tried to use write function into txt file .
Rich (BB code):
using System;
using System.IO;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
string path = @"c:\book\New Text Document.txt";
private void button1_Click(object sender, EventArgs e)
{
File.WriteAllText(path, textBox1.Text);
File.WriteAllText(path, textBox2.Text);
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
this.Text = textBox1.Text;
}
private void textBox2_TextChanged(object sender, EventArgs e)
{
this.Text = textBox2.Text;
}
}
}
Last edited by a moderator: