MS frmTest

This commit is contained in:
SchreiberM 2021-03-25 15:49:49 +01:00
parent f3f6599fc0
commit 733bc86e7f

View File

@ -40,17 +40,22 @@ Public Class frmtest
End Sub
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
Try
Using oInputStream As New FileStream(txtIDBFOPath.Text, FileMode.Open)
Dim oContents(oInputStream.Length) As Byte
oInputStream.Read(oContents, 0, oInputStream.Length)
' convert string to stream
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.pdf", FileMode.Create, FileAccess.Write)
oMemoryStream.WriteTo(oFileStream)
End Using
End Using
End Using
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical)
End Try
End Sub
End Class