Created
June 27, 2013 15:23
-
-
Save haeky/5877379 to your computer and use it in GitHub Desktop.
Example of a StreamReader/StreamWriter in C# to modify a specific line.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using (StreamWriter wStreamWriter = new StreamWriter(wPathTarget)) | |
{ | |
using (StreamReader wStreamReader = new StreamReader(wPathSource)) | |
{ | |
while ((wLine = wStreamReader.ReadLine()) != null) | |
{ | |
if (!wLine.Contains(iPackageName)) | |
{ | |
wStreamWriter.WriteLine(wLine); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment