Source Code : This finger client allows you to query a remote host.

Java Is Open Source Programming Language You Can Download From Java and Java Libraries From http://www.oracle.com. Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://www.oracle.com. Click Here or search from google with Libraries Name you get jar file related it

This finger client allows you to query a remote host.

/*       
Chapter 3 - Simple Protocols
Java 2 Network Protocols Black Book
by Al Williams    
Paraglyph Press 2001
*/

import java.net.*;
import java.io.*;

public class Finger {
    public String finger(String host, String users) 
       throws IOException, SocketException {
       String outstring="";
       int c=0;
       Socket sock=new Socket(host,79);
       OutputStream os = sock.getOutputStream();
       InputStream is = sock.getInputStream();
       users = users + "
";
       os.write(users.getBytes("iso8859_1"));
       try {
           while (c!=-1) {
             c=is.read();
             if (c!=-1) outstring+=(char)c;
           }
       }
       catch (IOException e) {}
       return outstring;
    }
    public static void main(String[] args) {
    
       String hostname = "";
       String ulist = "";
       if (args.length==0) {
           System.out.println("usage: finger host [user]");
           System.exit(1);
       }
       if (args.length>=2) 
           for (int i=1; i<args.length; i++) 
             ulist+=args[i]+" ";
       hostname=args[0];
       Finger worker = new Finger();
       try {
         System.out.println(worker.finger(hostname,ulist.trim()));
       }
       catch (Exception e) {
           System.out.println(e);
       }
    }
}

           
       

Thank with us