SyntaxHighlighter.all();

@ : 키워드를 문자 자체로 인식하도록 합니다. 

https://docs.microsoft.com/ko-kr/dotnet/csharp/language-reference/tokens/verbatim

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
public static void Main(string[] args)
{
            string path = @"C:\Users\kyz11\OneDrive\바탕 화면\sampleA.txt";
            
            FileStream fs = new FileStream(path, FileMode.Open);
            BinaryReader sr = new BinaryReader(fs);
 
            // read byte
            byte[] readBytes = sr.ReadBytes(1000);
 
            foreach(var item in readBytes)
            {
                Console.Write((char)item);
            }
}
 
 

 

[결과]

sample.txt에 저장된 apple을 읽어온 결과

반응형

+ Recent posts