This commit is contained in:
SchreiberM 2021-03-19 14:05:52 +01:00
commit 97dca56181

View File

@ -40,14 +40,17 @@ Public Class frmtest
End Sub End Sub
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
Dim memString As String = "Memory test string !!!" Using oInputStream As New FileStream(txtIDBFOPath.Text, FileMode.Open)
Dim buffer As Byte() = Encoding.UTF8.GetBytes(memString) Dim oContents(oInputStream.Length) As Byte
oInputStream.Read(oContents, 0, oInputStream.Length)
' convert string to stream ' convert string to stream
Using oMemoryStream As New MemoryStream(buffer) Using oMemoryStream As New MemoryStream(oContents)
Using oFileStream As New FileStream("d:\file.txt", FileMode.Create, FileAccess.Write) Using oFileStream As New FileStream("d:\file.txt", FileMode.Create, FileAccess.Write)
oMemoryStream.WriteTo(oFileStream) oMemoryStream.WriteTo(oFileStream)
End Using End Using
End Using End Using
End Using
End Sub End Sub
End Class End Class