Private Sub DLpngSub
Sleep(1)
ctm.InitializeAcceptAll
FTP.Initialize("xxx", "xxx", 21, "xxx", "xxx")
FTP.PassiveMode = True
FTP.UseSSLExplicit = True
FTP.SetCustomSSLTrustManager(ctm)
FTP.SendCommand("CWD", "/test/png")
If FTP.IsInitialized=True Then
Log("ok")
else if FTP.IsInitialized=False Then
Log("No")
End If
Dim sf1 As Object = FTP.DownloadFile("test.png", True, xui.DefaultFolder, "test.png")
Wait For (sf1) ftp_DownloadCompleted (ServerPath As String, Success As Boolean)
If Success Then
'Sleep(100)
Log("dl successfully")
FTP.SendCommand("CWD", "..")
Else
Log("Error downloading")
ToastMessageShow("DL error", True)
End If
FTP.Close
Log("close")
CallSubDelayed(Me, "DLpngSub_Complete")
End Sub
Private Sub Information_LongClick
DLpngSub
Wait For DLpngSub_Complete
'File.Copy(File.DirAssets, personalid & ".png", xui.DefaultFolder, personalid & ".png")
Log(File.ReadBytes(xui.DefaultFolder, "test.png"))
If File.Exists(xui.DefaultFolder, "test.png") = True Then
ImageView.SetBitmap(xui.LoadBitmapResize(xui.DefaultFolder, "test.png",ImageView.Width,ImageView.Height,True))
End If
PanelPic.BringToFront
End Sub