Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ssis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vb.net 可以将TextFieldParser与字节一起使用吗?_Vb.net_File Io_Csv - Fatal编程技术网

Vb.net 可以将TextFieldParser与字节一起使用吗?

Vb.net 可以将TextFieldParser与字节一起使用吗?,vb.net,file-io,csv,Vb.net,File Io,Csv,可以在字节上使用TextFieldParser吗?我正在使用Byte通过Web服务上传一个文件,我很难确定是否可以直接访问此CSV,或者是否需要先将其写入磁盘。将其写入磁盘将很容易,但我不相信我需要这样做 接受System.IO.Stream、System.String(文件路径)或System.IO.TextReader,但我无法确定是否可以轻松将字节放入其中 这就是我正在看的和我想做的(这段代码不起作用) 您可以将字节数组读入一个-TextFieldParser将接受它 Using MemS

可以在
字节上使用TextFieldParser吗?我正在使用
Byte
通过Web服务上传一个文件,我很难确定是否可以直接访问此CSV,或者是否需要先将其写入磁盘。将其写入磁盘将很容易,但我不相信我需要这样做

接受
System.IO.Stream
System.String
(文件路径)或
System.IO.TextReader
,但我无法确定是否可以轻松将字节放入其中

这就是我正在看的和我想做的(这段代码不起作用)


您可以将
字节
数组读入一个-
TextFieldParser
将接受它

Using MemStream As New MemoryStream(FileBytes)
    Using MyReader As New Microsoft.VisualBasic.FileIO.TextFieldParser(MemStream)
        MyReader.TextFieldType = FileIO.FieldType.Delimited
        MyReader.SetDelimiters(",")
        'other code here
    End Using
End Using

我不知道你能做到,为你+1!
Using MemStream As New MemoryStream(FileBytes)
    Using MyReader As New Microsoft.VisualBasic.FileIO.TextFieldParser(MemStream)
        MyReader.TextFieldType = FileIO.FieldType.Delimited
        MyReader.SetDelimiters(",")
        'other code here
    End Using
End Using