FTP does not connect :(

vinians

Member
Licensed User
Longtime User
Im trying to connect to an ftp but its not working and Im testing it using the ftp DOS command and work properly. See my code, whats wrong?

B4X:
Sub btnSincronizarAgora_Click
   ErrorLabel(ErrorConexion)
     Message = "Create the object"
   ftp.New1
   WaitCursor(True)
   Message = "Connecting"
   ftp.Open(FTP_HOST, FTP_USUARIO, FTP_SENHA)
   WaitCursor(False)
   ErrorLabel(ErrorListing)
   FTP_ARQUIVOS() = ftp.GetEntries()
   goto go1
ErrorConexion:
   Erro("Error " & Message)
   Return
ErrorListing:
   Erro("Error listing the files")
   ftp.Close
   Return
go1:
   ftp.Close    
End Sub
Remarks: FTP_HOST, FTP_USUARIO and FTP_SENHA are correctly defined
 

agraham

Expert
Licensed User
Longtime User
ftp.Open(...) error:
System.security.Permission.SecurityPermission error
This looks to me like you probably have a .NET Framework Security settings issue. One of the design aims of .NET was to provide security levels that are impossible to achieve in non-managed code and the security settings can be tuned to achieve different levels of security appropriate to different environments.

You need to increase the permissions that B4PPC runs under to allow it to access the Internet. I am not even going to try to advise you on how to do this and the exact way of achieving it is different under .NET 1.1 and .NET 2.0. I suggest that you Google around for ".NET security" or ".NET permissions" and see what you come up with.
 
Top