Private Sub SerialPort1_DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles SerialPort1.DataReceived Dim string_data As String Dim binary_data() As Byte string_data = SerialPort1.ReadExisting binary_data = System.Text.Encoding.ASCII.GetBytes(string_data) SaveFile.ShowDialog() Dim fs As IO.FileStream = New IO.FileStream(SaveFile.FileName, IO.FileMode.Create) Dim bw As BinaryWriter = New IO.BinaryWriter(fs) bw.Write(binary_data) bw.Flush() bw.Close() fs.Close()
Thanks in advance
J

New Topic/Question
Reply



MultiQuote




|