MS Zooflow Test
This commit is contained in:
@@ -34,7 +34,8 @@ Public Class frmtest
|
||||
|
||||
Using oStream As New FileStream(txtFile2Import.Text, FileMode.Open, FileAccess.Read)
|
||||
Dim oContents(oStream.Length) As Byte
|
||||
oStream.Read(oContents, 0, System.Convert.ToInt32(oStream.Length))
|
||||
|
||||
oStream.Read(oContents, 0, oStream.Length)
|
||||
|
||||
oResult = Await _Client.ImportIDBFOAsync(oContents, My.Application.User.UserName, txtIDB_OBJ_ID.Text, 1, txtIDBFOPath.Text)
|
||||
End Using
|
||||
@@ -51,23 +52,37 @@ Public Class frmtest
|
||||
|
||||
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
|
||||
Try
|
||||
Dim oextension = Path.GetExtension(txtFile2Import.Text)
|
||||
Dim oFile = $"E:\file{oextension}"
|
||||
Using oInputStream As New FileStream(txtIDBFOPath.Text, FileMode.Open)
|
||||
Dim oextension = Path.GetExtension(txtFile2Import.Text)
|
||||
|
||||
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($"E:\file{oextension}", FileMode.Create, FileAccess.Write)
|
||||
Using oFileStream As New FileStream(oFile, FileMode.Create, FileAccess.Write)
|
||||
oMemoryStream.WriteTo(oFileStream)
|
||||
End Using
|
||||
End Using
|
||||
End Using
|
||||
|
||||
Dim oPAth = Path.GetDirectoryName(oFile)
|
||||
MsgBox($"File [{oFile}] created!", MsgBoxStyle.Information)
|
||||
Process.Start(oPAth)
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
|
||||
Try
|
||||
Dim wFile As System.IO.FileStream
|
||||
Dim byteData() As Byte
|
||||
Dim oextension = Path.GetExtension(txtFile2Import.Text)
|
||||
byteData = Encoding.ASCII.GetBytes(txtFile2Import.Text)
|
||||
wFile = New FileStream($"E:\file{oextension}", FileMode.Append)
|
||||
wFile.Write(byteData, 0, byteData.Length)
|
||||
wFile.Close()
|
||||
Catch ex As IOException
|
||||
MsgBox(ex.ToString)
|
||||
End Try
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user