bhuraasif
July 24th, 2006, 02:34 AM
Dear
I want code to read a text files and adding something to that. i want to write same file after being made some changes to that files.
Please help me out
I tried like this
TextReader tr = new StreamReader("myappcounter.txt");
string i =tr.ReadLine();
i = i+1;
TextWriter te = new StreamWriter("myappcounter.txt");
te.WriteLine(i);
te.Close();
tr.Close();
as per my code it read perfectly.
but it doesnt add value.
as example in my text file there is value 5 when i add to '' i=i+1 ".
it doesnt become 6 but it becomes 51.
one more problem when debugging goes to bolded line
it gives me error like access denied
please help me and send me some code
Actually i want to create counter
Regards,
ASIF
I want code to read a text files and adding something to that. i want to write same file after being made some changes to that files.
Please help me out
I tried like this
TextReader tr = new StreamReader("myappcounter.txt");
string i =tr.ReadLine();
i = i+1;
TextWriter te = new StreamWriter("myappcounter.txt");
te.WriteLine(i);
te.Close();
tr.Close();
as per my code it read perfectly.
but it doesnt add value.
as example in my text file there is value 5 when i add to '' i=i+1 ".
it doesnt become 6 but it becomes 51.
one more problem when debugging goes to bolded line
it gives me error like access denied
please help me and send me some code
Actually i want to create counter
Regards,
ASIF