VB.NET
소스  

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