VB二进制文件读写

数组存取
 

存数组
Private Sub Command2_Click()
Dim fileNumber As Integer
Dim S9 As String
Dim k As Integer
Dim l As Integer
 
On Error Resume Next
fileNumber = FreeFile()
S9 = "D:\zs.txt"
If Dir(S9) <> "" Then Kill S9
Open S9 For Binary As #fileNumber
k = UBound(arr)
Put #fileNumber, , k
Put #fileNumber, , arr
l = UBound(azz)
Put #fileNumber, , l
Put #fileNumber, , azz
Close #fileNumber
 
End Sub

读数组
Private Sub Command3_Click()
Dim fileNumber As Integer
Dim S9 As String
Dim k As Integer
Dim l As Integer
Dim ayy() As Integer
Dim akk() As Integer
On Error Resume Next
fileNumber = FreeFile()
S9 = "D:\zs.ini"
Open S9 For Binary As #fileNumber
Get #fileNumber, , k
ReDim ayy(k)
Get #fileNumber, , ayy
Get #fileNumber, , l
ReDim akk(l)
Get #fileNumber, , akk
Close #fileNumber
 
End Sub
结构体读写
posted @ 2017-06-15 13:57  吴雨欣  阅读(1517)  评论(0编辑  收藏  举报
友情链接:回力鞋官网 | 中老年高档女装