ZooFlow: frmTest import/export works now with excel files!
This commit is contained in:
@@ -33,11 +33,11 @@ Public Class frmtest
|
||||
Dim oResult As Boolean = False
|
||||
|
||||
Using oStream As New FileStream(txtFile2Import.Text, FileMode.Open, FileAccess.Read)
|
||||
Dim oContents(oStream.Length) As Byte
|
||||
|
||||
oStream.Read(oContents, 0, oStream.Length)
|
||||
|
||||
oResult = Await _Client.ImportIDBFOAsync(oContents, My.Application.User.UserName, txtIDB_OBJ_ID.Text, 1, txtIDBFOPath.Text)
|
||||
Using oMemoryStream As New MemoryStream
|
||||
oStream.CopyTo(oMemoryStream)
|
||||
Dim oContents As Byte() = oMemoryStream.ToArray()
|
||||
oResult = Await _Client.ImportIDBFOAsync(oContents, My.Application.User.UserName, txtIDB_OBJ_ID.Text, 1, txtIDBFOPath.Text)
|
||||
End Using
|
||||
End Using
|
||||
|
||||
If oResult = False Then
|
||||
@@ -55,13 +55,8 @@ Public Class frmtest
|
||||
Dim oextension = Path.GetExtension(txtFile2Import.Text)
|
||||
Dim oFile = $"E:\file{oextension}"
|
||||
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(oFile, FileMode.Create, FileAccess.Write)
|
||||
oMemoryStream.WriteTo(oFileStream)
|
||||
End Using
|
||||
Using oFileStream As New FileStream(oFile, FileMode.Create, FileAccess.Write)
|
||||
oInputStream.CopyTo(oFileStream)
|
||||
End Using
|
||||
End Using
|
||||
Dim oPAth = Path.GetDirectoryName(oFile)
|
||||
@@ -85,4 +80,17 @@ Public Class frmtest
|
||||
MsgBox(ex.ToString)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
|
||||
If OpenFileDialog1.ShowDialog() = DialogResult.OK Then
|
||||
txtFile2Import.Text = OpenFileDialog1.FileName
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click
|
||||
Dim oExt = Path.GetExtension(txtFile2Import.Text)
|
||||
Dim oFile = $"E:\file{oExt}"
|
||||
|
||||
File.Copy(txtIDBFOPath.Text, oFile)
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user