Telnet连接到远程计算机并在其上找到firefox版本

时间:2017-06-08 15:54:19

标签: java browser version telnet

我使用以下程序建立了与远程计算机的telnet连接,现在我希望找到远程计算机上存在的firefox浏览器的版本。我该怎么做?

telnet连接程序:

package conn;
import org.springframework.*;
import javax.servlet.http.HttpServlet;
import org.apache.commons.net.telnet.TelnetClient;

public class BV1 extends HttpServlet
{
    private TelnetClient telnet = new TelnetClient();

    public BV1(String server, String user, String password )
    {
        try
        {
            telnet.connect(server, 3389);
            System.out.println("Connected to : "+server);


            telnet.getKeepAlive();
            System.out.println("Is telnet connected : "+telnet.isConnected());



            telnet.disconnect();
            System.out.println("Is telnet connected : "+telnet.isConnected());
        }
        catch(Exception e)
        {
            e.printStackTrace();
        }
    }

    private String getCurrentWorkingDirectory() {
        // TODO Auto-generated method stub
        return null;
    }

    public static void main(String args[])
    {
        try 
        {
             BV1 telnet = new BV1("remotehost_server","username","password");
        }
        catch (Exception e) 
        {
             e.printStackTrace();
        }
    }
}

1 个答案:

答案 0 :(得分:1)

要使其正常工作,请确保一台计算机位于另一台计算机的TelnetClients组中。