Module mdl_Main
Sub main()
Dim FileNum As Integer
Dim FileName As String
Dim txtLine As String
FileNum = FreeFile()
FileName = System.IO.Directory.GetCurrentDirectory & "\Test.txt"
'내용 덮어쓰기
FileOpen(FileNum, FileName, OpenMode.Output)
Print(FileNum, "TEST")
FileClose(FileNum)
'내용 추가하기
FileOpen(FileNum, FileName, OpenMode.Append)
Print(FileNum, vbCrLf & "TEST")
FileClose(FileNum)
'한줄씩 읽기
FileOpen(FileNum, FileName, OpenMode.Input)
Do While Not EOF(FileNum)
Input(FileNum, txtLine)
MsgBox(txtLine)
Loop
FileClose(FileNum)
'전체 읽기
FileOpen(FileNum, FileName, OpenMode.Input)
txtLine = InputString(FileNum, LOF(FileNum))
MsgBox(txtLine)
FileClose(FileNum)
End Sub
End Module
vnote
IO.File.ReadAllLines("c:\ne.txt", System.Text.Encoding.Default)
이 댓글을
Dim f As New System.IO.StreamWriter("파일이름", True, System.Text.Encoding.UTF8)
이 댓글을