Sub Process_Globals
Dim mySMB As SMB
Dim User As String = "YourUsername"
Dim Passwd As String = "YourPassword"
Dim Domain As String = ""
Dim smbURL As String = "smb://YourDevice/backup/" 'YourDevice= localIP or DeviceName
Dim myFTP As FTP
Dim Host As String = "YourIP" ' lan or wan
Dim Port As Int = 21 'Standard port
End Sub
Sub AppStart (Form1 As Form, Args() As String)
WriteViaSMB
WriteViaFTP
End Sub
'Return true to allow the default exceptions handler to handle the uncaught exception.
Sub Application_Error (Error As Exception, StackTrace As String) As Boolean
Return True
End Sub
Sub WriteViaFTP
myFTP.Initialize( "myFTP", Host, Port, User, Passwd)
myFTP.UploadFile( File.DirAssets, "testfile.txt", True, "/backup/testftp.txt")
wait for myFTP_UploadCompleted (ServerPath As String, Success As Boolean)
Log( Success)
End Sub
Sub WriteViaSMB
mySMB.Initialize( "mySMB")
mySMB.SetCredentials( User, Passwd, Domain)
mySMB.UploadFile( File.DirAssets, "testfile.txt", smbURL, "testsmb.txt")
wait for mySMB_UploadCompleted (Url As String, RemoteFile As String, Success As Boolean)
Log( Success)
End Sub