From 733bc86e7f9f81756e827d0d5a6fc3de67c9e324 Mon Sep 17 00:00:00 2001 From: Digital Data - Marlon Schreiber Date: Thu, 25 Mar 2021 15:49:49 +0100 Subject: [PATCH] MS frmTest --- GUIs.ZooFlow/frmtest.vb | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/GUIs.ZooFlow/frmtest.vb b/GUIs.ZooFlow/frmtest.vb index ff4b397f..a715a09e 100644 --- a/GUIs.ZooFlow/frmtest.vb +++ b/GUIs.ZooFlow/frmtest.vb @@ -40,17 +40,22 @@ Public Class frmtest End Sub Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click - 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) - oMemoryStream.WriteTo(oFileStream) + 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.pdf", FileMode.Create, FileAccess.Write) + oMemoryStream.WriteTo(oFileStream) + End Using End Using End Using - End Using + + Catch ex As Exception + MsgBox(ex.Message, MsgBoxStyle.Critical) + End Try End Sub End Class \ No newline at end of file