string path = Server.MapPath("~/");
TextWriter tw = new StreamWriter(path+"Textsample.txt",true);
// write a line of text to the file
tw.WriteLine(txtresult.Text);
// close the stream
tw.Close();
txtfieldname.Text = "";
txtvalue.Text = "";
txtresult.Text = "";
StreamReader tr = new StreamReader(path + "Textsample.txt");
//TextReader tr = new TextReader(path + "Textsample.txt");
// read a line of text
//Console.WriteLine(tr.ReadLine());
var lineCount = File.ReadAllLines(path + "Textsample.txt").Length;
//Response.Write(lineCount);
for (int i = 0; i < lineCount; i++)
{
txtresult.Text += tr.ReadLine();
}
// close the stream
tr.Close();
TextWriter tw = new StreamWriter(path+"Textsample.txt",true);
// write a line of text to the file
tw.WriteLine(txtresult.Text);
// close the stream
tw.Close();
txtfieldname.Text = "";
txtvalue.Text = "";
txtresult.Text = "";
StreamReader tr = new StreamReader(path + "Textsample.txt");
//TextReader tr = new TextReader(path + "Textsample.txt");
// read a line of text
//Console.WriteLine(tr.ReadLine());
var lineCount = File.ReadAllLines(path + "Textsample.txt").Length;
//Response.Write(lineCount);
for (int i = 0; i < lineCount; i++)
{
txtresult.Text += tr.ReadLine();
}
// close the stream
tr.Close();