■ 순차 파일 쓰고 읽는 방법을 보여준다.
▶ 예제 코드 (VB)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
Open "c:\sample.txt" For Output As #1 Print #1, "김철수" Print #1, "홍길동" Print #1, "김영희" Close #1 Dim strText As String Open "c:\sample.txt" For Input As #2 Do While Not EOF(2) Line Input #2, strText Print strText Loop Close #2 |