52 lines
1.9 KiB
VB.net
52 lines
1.9 KiB
VB.net
|
|
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
|
|
My.Settings.Save()
|
|
Dim oString As String
|
|
oString = _Client.NewFileStoreObject(txtIDB_OBJ_ID.Text, txtFilestoreType.Text, txtDate.Text)
|
|
txtIDBFOPath.Text = oString
|
|
End Sub
|
|
|
|
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
|
|
Dim oString As String
|
|
oString = _Client.NewIDB_OBJ_ID("DOC", My.Application.User.UserName, "")
|
|
txtIDB_OBJ_ID.Text = oString
|
|
End Sub
|
|
|
|
Private Async Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
|
|
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
|
|
|
|
End Sub
|
|
|
|
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 |