> I have downloaded the jar files for jakarta commons
> and jakarta oro..
> but not really getting there..Although i can telnet i
> am failing to give the user id/passwd to my remote
> server...can u plz help me with the code?
I don't understand the question.
You do of course need to write code that correctly delivers the user/pwd in the way that the server expects.
Have you written that code?
If yes then the error number that is returned will tell you what problems there are.
If not then why not? If you don't know how telnet works at all then you are going to need to find a tutorial on that before you can use the API (any API for that matter.)
Yes surely I have wriiten the code..
I have first used a Socket to connect to teh host at port 23.
Then i am using outstream to give the user and passwd .. but in my Inputstream i am getting some vague outputs (some symbols..$,%,etc..) This is the code for ur reference....
import java.net.*;
import java.io.*;
class Telclient {
public static void main(String args[]) {
int c;
try{
Socket s=new Socket("abc.net",23);
InputStream in=s.getInputStream();
OutputStream out=out.getoutputStream();
String str="user" + "\n" + "password" + "\n";
byte buf[]=str.getBytes();
out.write(buf);
while((c=in.read()) != -1) {
System.out.println((char)c);
}
s.close();
}
}
Please help with teh code , bcoz its not really working..Need urgent helpI also used TelnetClient from jakarta , but failing to understand
how to use those classes to use..can anyone show me an example...