MSZooFlow Test Import Datei

This commit is contained in:
2021-03-16 09:24:50 +01:00
parent 4ab7772609
commit 48ab3c9977
7 changed files with 129 additions and 20 deletions

View File

@@ -2,6 +2,7 @@
Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.EDMI.API
Imports System.IO
Imports System.Text
Public Class frmtest
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
@@ -18,19 +19,34 @@ Public Class frmtest
End Sub
Private Async Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
Dim oResult As Boolean
Dim oStream As New FileStream(TextBox1.Text, FileMode.Open)
Dim oContents(oStream.Length) As Byte
Dim oBytesRead = Await oStream.ReadAsync(oContents, 0, oStream.Length)
Try
Dim oResult As Boolean
Dim oStream As New FileStream(txtFile2Import.Text, FileMode.Open)
Dim oContents(oStream.Length) As Byte
'Dim oBytesRead = Await oStream.ReadAsync(oContents, 0, oStream.Length)
oResult = Await _Client.ImportIDBFOAsync(oContents, My.Application.User.UserName, txtIDB_OBJ_ID.Text, 1, txtIDBFOPath.Text)
If oResult = False Then
MsgBox("Oh no error", MsgBoxStyle.Critical)
Else
MsgBox("#Nailedit")
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
oResult = Await _Client.ImportIDBFOAsync(oContents, My.Application.User.UserName, txtIDB_OBJ_ID.Text, 1, txtIDBFOPath.Text)
If oResult = False Then
MsgBox("Oh no error", MsgBoxStyle.Critical)
Else
MsgBox("#Nailedit")
End Sub
End If
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
Dim memString As String = "Memory test string !!!"
' convert string to stream
Dim buffer As Byte() = Encoding.ASCII.GetBytes(memString)
Dim ms As New MemoryStream(buffer)
'write to file
Dim file As New FileStream("d:\file.txt", FileMode.Create, FileAccess.Write)
ms.WriteTo(file)
file.Close()
ms.Close()
End Sub
End Class