get file content c# code example
Example 1: read file c#
string text = File.ReadAllText(@"c:\file.txt", Encoding.UTF8);
Example 2: c# read all text from a file
using (StreamReader streamReader = new StreamReader(path_name, Encoding.UTF8))
{
contents = streamReader.ReadToEnd();
}
Example 3: c# get file author
File.GetAccessControl(path).GetOwner(typeof(System.Security.Principal.NTAccount))
// or
File.GetAccessControl(path).GetGroup(typeof(System.Security.Principal.NTAccount)).Value