Hi Dmitriy,
You can't simply change the data inside a file, you need to read the file into a temporary storage, adjust the data and write it back to the file.
You can do that in several ways:
1) Read the file as a Stream and feed the Stream into a temporary file, replacing the string when you get to it. Replace the old file with the temporary file when done.
2) Read the file into memory (as a string or memorystream), change the data, write the data back to the file.
3) If the new string is the same length as the old and the file is using a fixed character length encoding, you could simply write the string after locating the position of the old string. If the strings are of different length or encoding in a variable length encoding, like UTF8, use method 1 or 2.