VB.Net/File Directory/File Open Mode — различия между версиями
| Admin (обсуждение | вклад) м (1 версия) | |
| (нет различий) | |
Версия 16:40, 26 мая 2010
Imports System
Imports System.Collections.ObjectModel
Imports System.IO
Public Class MainClass
   Shared Sub Main()
        " Get an available file number.
        Dim file_num As Integer = FreeFile()
        " Open the file.
        Dim file_name As String = "test.txt"
        FileOpen(file_num, file_name, _
            OpenMode.Input, OpenAccess.Read, OpenShare.Shared)
        " Read the file"s lines.
        Do While Not EOF(file_num)
            " Read a line.
            Dim txt As String = LineInput(file_num)
            Console.WriteLine(txt)
        Loop
        " Close the file.
        FileClose(file_num)
   End Sub 
End Class