2013-12-02

JAVA Example - Telnet Client

Required Library: apache.commons.net


========================================

import org.apache.commons.net.telnet.TelnetClient;

import java.io.InputStream;
import java.io.PrintStream;

public class AutomatedTelnetClient {
    private TelnetClient telnet = new TelnetClient();
    private InputStream in;
    private PrintStream out;
    private String prompt = "%";

Java - Input library of "apache.commons.net" to IDE Eclipse.

1-
由下面連結下載 "commons-net-3.3-bin.zip".
http://commons.apache.org/proper/commons-net/download_net.cgi

2-
解壓縮 commons-net-3.3-bin.zip

3-
Execute Eclipse --> create a new java project

4-
Left click on project --> Build Path --> Configure Build Path...
On Libraries tab --> Add External JARs...
Browse a file "commons-net-3.3.jar" where you put on.



5-
A Library "commons-net-3.3.jar" should listed on left side Project Explorer.