Saturday, August 30, 2014

remove errors in the logfile

Read the entire file into a string, modify the string, write string back to file



using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
string file = File.ReadAllText("filename");
//make changes
File.WriteAllText("filename",file);
}
}
}





jdweng


No comments:

Post a Comment