随机文件放到DataGridView1怎么做啊
vb.net吧
全部回复
仅看楼主
level 2
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
level 2
上面是我写的代码,但是根本读不出来,不知道为什么啊!!!!
2013年06月06日 08点06分 2
level 2
跪求大神帮忙
2013年06月06日 14点06分 3
level 10
Len(student(99)) 换成 Len(studenttype)
2013年06月20日 01点06分 4
1