using var sr new streamreader(path)) while running code example Example: streamreader c# streamreader c#