2007/10/17(Wed) 18:24:43 編集(投稿者)
■No9049 (えふ さん) に返信
へぇ〜、FileGet ってのがあるのですか。
なにやら、My.Computer.FileSystem ... を代わりに使うとパフォーマンス
が向上する、ってインテリセンスのツールチップテキストに書いてありま
せんか?
ByRef の代替手段はわかりません。m(__)m
下は手作り。手作りしなくても良さそうですね。
Module Module1
Private sa() As Integer = {100, 200, 300, 400, 500, 600}
Sub Main()
WriteTest()
System.Console.In.ReadLine()
ReadTest()
System.Console.In.ReadLine()
End Sub
Sub ReadTest()
Dim ar(2 - 1, 3 - 1) As Integer
Dim br As New System.IO.BinaryReader(New System.IO.FileStream("array.bin", IO.FileMode.Open))
For i As Integer = 0 To 2 - 1
For j As Integer = 0 To 3 - 1
ar(i, j) = br.ReadInt32()
Next
Next
For i As Integer = 0 To 2 - 1
For j As Integer = 0 To 3 - 1
Console.WriteLine(ar(i, j))
Next
Next
br.Close()
End Sub
Sub WriteTest()
Dim ar(2 - 1, 3 - 1) As Integer
Dim bw As New System.IO.BinaryWriter(New System.IO.FileStream("array.bin", IO.FileMode.OpenOrCreate))
For i As Integer = 0 To 2 - 1
For j As Integer = 0 To 3 - 1
ar(i, j) = sa(i * 3 + j)
Next
Next
For i As Integer = 0 To 2 - 1
For j As Integer = 0 To 3 - 1
bw.Write(ar(i, j))
Next
Next
bw.Close()
End Sub
End Module