I want to make I thing where this program takes a .txt and replaces letter with numbes. I know how to do this with a text box (.replace) but how to I do it to a txt file
Printable View
I want to make I thing where this program takes a .txt and replaces letter with numbes. I know how to do this with a text box (.replace) but how to I do it to a txt file
Read your file with File.ReadAllText(string path) and then you can do FileWriteAllText(string path, string content)
This would be better
Code:using System;
using System.IO;
class Program
{
static void Main()
{
//
// It will free resources on its own.
//
string line;
using (StreamReader reader = new StreamReader("file.txt"))
{
line = reader.ReadLine();
}
Console.WriteLine(line);
}
}