从文件读取到2d数组时

时间:2013-01-19 18:59:21

标签: arrays vb.net streamreader streamwriter

我想知道如何读出文件并在不同标签上显示数据。 如果任何人都可以建议一种有效的方法来执行这些100项目的差异文件位置,那将是适当的。

 Private Sub BtnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnSave.Click         If RadFriday.Checked = True Then
            Select Case Row 
                Case 0 
                    Customer(0, 0) = New StreamWriter("D:\theater seats\friday\A1Seat.txt") 
                    Customer(0, 0).Write(ArrayFS(0, 0, 0) & (" ") & ArrayFS(0, 0, 1) & (", ") & ArrayFS(0, 0, 2) & (", ") & ArrayFS(0, 0, 3) & (", ") & ArrayFS(0, 0, 4) & (", ") & ArrayFS(0, 0, 5) & (", ") & ArrayFS(0, 0, 6) & (", ") & ArrayFS(0, 0, 7))
                    MsgBox("Data has been stored.") 
                    Customer(0, 0).Close() 
            End Select 
  End If

    End Sub
Private Sub BtnRead_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnRead.Click 
            Select Case Row 
                Case 0 
                    LblName.Text = "" 
                    CustomerLoad(0, 0, 0) = New StreamReader("D:\theater seats\friday\A1Seat.txt")
                    LblName.Text = CustomerLoad(0, 0, 0).ReadToEnd
                    If LblName.Text = "" Then
                        MsgBox("There is no data stored for this seat!")
                    Else
                        CustomerLoad(0, 0, 0).Close()
                    End If
            End Select
        ElseIf RadSaturday.Checked = True Then

        End If
End Sub

0 个答案:

没有答案