VB将csv文件作为数据库进行查询

时间:2016-02-06 14:57:02

标签: database vb.net csv

Visual Basic(2013)拒绝正常工作,所以我无法测试我的代码,因为你可能会说我没有任何线索。我试图从csv文件中获取信息并使用VB将csv中的某些数据写入单独的文本文件。 到目前为止,这是我的代码:

Imports System.IO

Public Class Form1
    Dim inFile As StreamReader = Nothing
    Dim outFile As StreamWriter = Nothing
    Dim sFilename As String = "C:\etc"
    Dim inputText As String
    Dim FileNumber As Integer
    Dim FileName As String = ""

    Private Sub ReadWrite()
        FileNumber = FreeFile()
        FileOpen(FileNumber, FileName, OpenMode.Output, OpenAccess.Write)
        outFile = New StreamWriter(sFilename)
        inFile = New StreamReader(sFilename)
        Dim i As String() = Split(sFilename, ",", , CompareMethod.Text)
        inputText = inFile.ReadToEnd()
        inFile.Close()
        TextBox2.Text() &= "Testtt mcgee" & vbCrLf
        TextBox2.Text() &= inputText

        TextBox2.Select(0, 0)
    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        ReadWrite()
    End Sub
End Class

它还远未完成,但我不知道下一步该做什么。

0 个答案:

没有答案