씨샵

· Csharp
Setup "System.IO" 네임스페이스를 추가해야 함 1 using System.IO; Usage - 파일 읽기 .txt 와 .dat 파일을 읽어서 사용함 File.ReadAllText : 파일의 모든 내용을 읽음 File.ReadAllLines : 파일의 내용을 한줄씩 읽음 1 2 3 string variable = File.ReadAllText("Path"); string[] variable = File.ReadAllLines("Path"); cs - 파일 작성 .txt와 .dat 확장자로 파일을 작성하여 저장함 덮어쓰기 1 2 3 StreamWrite writer = new StreamWriter("Path"); writer.WriteLine(string); writer.Write(string..
sckwon770
'씨샵' 태그의 글 목록