Created
August 5, 2020 17:50
-
-
Save nanwang2016/a098ade5a6052fb0c1c0340e3c5a4a1e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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