怎样用vb.net读取csv文件?急。。。死了!在线等!
那位高手能给我个例子用vb.net读取cav文件阿,一次性读出来就行了!
[解决办法]
csv文件就是文本文件,你可以用以下函数来读取:
Public Function GetTxtFile(ByVal TxtFn As String) As String() Dim sr As IO.StreamReader Dim tmpstr As String Dim R() As String Dim Rn As Long sr = IO.File.OpenText(TxtFn) tmpstr = sr.ReadLine() Rn = 0 While Not tmpstr Is Nothing ReDim Preserve R(Rn) R(Rn) = tmpstr tmpstr = sr.ReadLine() Rn += 1 End While sr.Close() Return R End Function