¡@

Home 

c# Programming Glossary: linetowrite

Edit a specific Line of a Text File in C#

http://stackoverflow.com/questions/1971008/edit-a-specific-line-of-a-text-file-in-c-sharp

target.txt Read the appropriate line from the file. string lineToWrite null using StreamReader reader new StreamReader sourceFile .. new StreamReader sourceFile for int i 1 i line_to_edit i lineToWrite reader.ReadLine if lineToWrite null throw new InvalidDataException.. int i 1 i line_to_edit i lineToWrite reader.ReadLine if lineToWrite null throw new InvalidDataException Line does not exist in sourceFile..