0

hie
i just want to know if someone can give me an exemple of how toreplace a data from a single data in a textfile .
i read that i need to use a temporary textfile but i still dont get it
thanks by advance

2
Contributors
5
Replies
6
Views
6 Years
Discussion Span
Last Post by jerome2467
0

for exemple :
i got a line with : james ,1000
i want to replace 1000 by whats in my textbox
i just cant figure out
the way i did it just erase all my data
thanks

0
String strFile = File.ReadAllText("c:\\File1.txt");
strFile = strFile.Replace("oldvalue", "newvalue");
File.WriteAllText("c:\\File1.txt", strFile);

Edited by Mitja Bonca: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.