我想知道如何通过虚拟串行端口发送大文件(任何类型)。我目前有这个:
Dim oFile As System.IO.FileInfo = New System.IO.FileInfo("largepic.jpg")
Dim numBytes As Long = oFile.Length
Dim fStream As New FileStream("largepic.jpg", FileMode.Open, FileAccess.Read)
Dim br As New BinaryReader(fStream)
Dim dataVals As Byte() = br.ReadBytes(CInt(numBytes))
br.Close()
fStream.Close()
Dim myserialport As New SerialPort("COM10", 9600, Parity.None, 8, StopBits.One)
If myserialport.IsOpen = False Then
myserialport.Open()
End If
myserialport.Write(dataVals, 0, dataVals.Length)
但是,当我尝试使用另一个应用程序读取串行端口时,我最多只能获得 4096 字节。如何制作它以便我可以发送所有可能的字节?