Question by
Perfectio_Bleats · Jun 04, 2017 at 03:23 PM ·
addwords
File I / O problems...
I want to implement it. If you read a line of text from a text file and find a particular character, you want to add the word I don't know. Please help me...
StreamReader srr = File.OpenText(Application.persistentDataPath + "/" + "filedata.txt"); FileInfo fi = new FileInfo(Application.persistentDataPath + "/" + "filedata.txt"); StreamWriter swr; string namemove,namerecive;
public void Button_Up1()
{
namemove = "1.";
ws();
}
void ws()
{
string filename;
int i = 0, k;
swr = fi.CreateText();
while ((filename = srr.ReadLine()) != null)
{
if(filename == namemove)
{
swr.WriteLine("ok");
}
}
srr.Close();
swr.Close();
}
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612123458im_/https://answers.unity.com/themes/thub/images/avi.jpg)