[Solved] C# How to modify text file [closed]


Add this reference first System.IO Then:

For reading:

string[] accounts= File.ReadAllLines("accounts.txt");
//each item of array will be your account

For modifying :

accounts[0] += "|1";//this adds "|1" near password
accounts[0].Replace("|1","|0"); this will change the "|0" text to "|1"

And For writing:

File.WriteAllLines("accounts.txt",accounts);

4

solved C# How to modify text file [closed]