CSharp examples for System.IO:Text File
Get File Content
using System.IO ; using System.Windows.Forms ; using System;/*from w w w .ja v a 2s. c om*/ public class Main{ public static string GetFileContent(string file_path) { if(! File.Exists(file_path)) { return null ; } StreamReader reader = new StreamReader(file_path ,System.Text.Encoding.Default ) ; string content = reader.ReadToEnd() ; reader.Close() ; return content ; } }