i got what i want here is the code (just for write):
public partial class Form1 : Form
{
FileProcess fileprocess;
public Form1()
{
InitializeComponent();
fileprocess = new FileProcess();
}
public void writeFile()
{
fileprocess.writeFile(textBox1.Text,textBox2.Text);
}
private void button1_Click(object sender, EventArgs e)
{
writeFile();
}
}
my class for work with the file :
class FileProcess
{
string path = @"c:\PhoneBook\PhoneBook.txt";
public void writeFile(string text1,string text2)
{
using (StreamWriter sw = new StreamWriter(path,true))
{
sw.WriteLine(text1);
sw.WriteLine(text2);
}
}
}
my mistake was that i try to store all textBox to a string like "info" and pass it through WriteFile() method and this is where i was stuck in it.
tnx to all.