Skip to content

Instantly share code, notes, and snippets.

@nanwang2016
Created August 5, 2020 17:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nanwang2016/a098ade5a6052fb0c1c0340e3c5a4a1e to your computer and use it in GitHub Desktop.
Save nanwang2016/a098ade5a6052fb0c1c0340e3c5a4a1e to your computer and use it in GitHub Desktop.
using System;
using System.IO;
namespace TestFile
{
class Program
{
//The text file's path is stored in 'filename'
static string filename = @"C:\Users\Nan\source\repos\Example.txt";
static void Main(string[] args)
{
static void ReadFile()
{
using (var fs = new FileStream(filename, FileMode.Open, FileAccess.Read))
{
var b1 = fs.ReadByte();
var c1 = (char)b1;
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment