|
-
July 11th, 2012, 02:16 PM
#1
Stream read help
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
.NET4.0 / VS 2010
-
July 12th, 2012, 02:09 AM
#2
Re: Stream read help
Read your file with File.ReadAllText(string path) and then you can do FileWriteAllText(string path, string content)
-
July 12th, 2012, 03:34 PM
#3
Re: Stream read help
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);
}
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|