MSDN 的帮助为什么不看?
Open Statement Example
This example illustrates various uses of the Open statement to enable input and output to a file.The following code opens the file TESTFILE in sequential-input mode.Open "TESTFILE" For Input As #1
' Close before reopening in another mode.
Close #1This example opens the file in Binary mode for writing operations only.Open "TESTFILE" For Binary Access Write As #1
' Close before reopening in another mode.
Close #1The following example opens the file in Random mode. The file contains records of the user-defined type Record.Type Record   ' Define user-defined type.
   ID As Integer
   Name As String * 20
End TypeDim MyRecord As Record   ' Declare variable.
Open "TESTFILE" For Random As #1 Len = Len(MyRecord)
' Close before reopening in another mode.
Close #1This code example opens the file for sequential output; any process can read or write to file.Open "TESTFILE" For Output Shared As #1
' Close before reopening in another mode.
Close #1This code example opens the file in Binary mode for reading; other processes can't read file.Open "TESTFILE" For Binary Access Read Lock Read As #1