level 2
贴吧用户_0b79QVR
楼主
Public Class Form1
Structure studenttype
<VBFixedString(8)> Dim xh As String
<VBFixedString(8)> Dim num As String
<VBFixedString(8)> Dim name As String
Dim time As Date
Dim xb As Char
<VBFixedString(8)> Dim mz As String
<VBFixedString(8)> Dim yx As String
<VBFixedString(8)> Dim zy As String
<VBFixedString(8)> Dim sf As String
Dim gkfs As Integer
End Structure
Public student(99) As studenttype
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim count As Integer
FileOpen(1, "date.dat", OpenMode.Random, , , Len(student(99)))
Do While Not EOF(1)
FileGet(1, student)
DataGridView1.Item(count, 0).Value = student(count).xh
DataGridView1.Item(count, 1).Value = student(count).num
DataGridView1.Item(count, 2).Value = student(count).name
DataGridView1.Item(count, 3).Value = student(count).time
DataGridView1.Item(count, 4).Value = student(count).xb
DataGridView1.Item(count, 5).Value = student(count).mz
DataGridView1.Item(count, 6).Value = student(count).yx
DataGridView1.Item(count, 7).Value = student(count).zy
DataGridView1.Item(count, 8).Value = student(count).sf
count = count + 1
Loop
FileClose(1)
End Sub
End Class
2013年06月06日 08点06分
1
Structure studenttype
<VBFixedString(8)> Dim xh As String
<VBFixedString(8)> Dim num As String
<VBFixedString(8)> Dim name As String
Dim time As Date
Dim xb As Char
<VBFixedString(8)> Dim mz As String
<VBFixedString(8)> Dim yx As String
<VBFixedString(8)> Dim zy As String
<VBFixedString(8)> Dim sf As String
Dim gkfs As Integer
End Structure
Public student(99) As studenttype
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim count As Integer
FileOpen(1, "date.dat", OpenMode.Random, , , Len(student(99)))
Do While Not EOF(1)
FileGet(1, student)
DataGridView1.Item(count, 0).Value = student(count).xh
DataGridView1.Item(count, 1).Value = student(count).num
DataGridView1.Item(count, 2).Value = student(count).name
DataGridView1.Item(count, 3).Value = student(count).time
DataGridView1.Item(count, 4).Value = student(count).xb
DataGridView1.Item(count, 5).Value = student(count).mz
DataGridView1.Item(count, 6).Value = student(count).yx
DataGridView1.Item(count, 7).Value = student(count).zy
DataGridView1.Item(count, 8).Value = student(count).sf
count = count + 1
Loop
FileClose(1)
End Sub
End Class