I am Creating a txt file in.Net with the help of below code.
StreamWriter writerVer = new StreamWriter(@"c:\Version.txt");
writerVer.WriteLine("Version : " + Context.Parameters["ver"]);
File.SetAttributes(@"C:\Version.txt", FileAttributes.Hidden);
Then I need to Update the file on the next line by keeping the above code as it is.
This code overrites the entire file.
StreamWriter writer = new StreamWriter(@"c:\Version.txt");
writer.WriteLine("Connection string : "+con);
Regrads,
Sachin K
try this
There is an overload of the
StreamWriterconstructor that takes an additionalboolparameter to indicate if you want to append or not.