Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
3k views
in Java FTP by (120 points)
OK, I am very knew to this so please bear with me. Say I have an IP Address that I would like to start an FTP with, is there any exact coding I use with the enterprisedt classes that take in an IP address, and logs into it with a given username and password? I have tried using InetAddress, but it does not regonize my IP address since it is a string. Thank you.

1 Answer

0 votes
by (220 points)
Just pass it as a String object to setRemoteHost(). I tried the following (Windows envirnment) and it worked:

MSDOS Batch file:
set JAVA_HOME=<your path to java>
set CP=.;..\lib\edtftpj.jar 
%JAVA_HOME%\bin\java -classpath %CP% Demo %1 %2 %3


Commandline (MSDOS shell):
demo 1.2.3.4 username pass1234


The arguments are, of course, passed as String objects to the 'main' method. The same thing shoud apply in a GUI. Or, to create a String object directly:

String host = new String("1.2.3.4");

Categories

...