我现在想将这四个文件从服务器\\10.2.95.88\temp目录下的四个文本文件:1.txt ,2.txt ,3.txt , 4.txt从服务器下载到本地机的C:\temp目录下,10.2.95.88装的是一个UNIX系统,用户名和密码都是admin?

解决方案 »

  1.   

    10.2.95.88上开通ftp或http客户端使用ftpclient或httpclient取文件就可以了
      

  2.   

    同意楼上了,使用协议,或者把\\10.2.95.88\temp设为共享
      

  3.   

    在10.2.95.88上 装个apache 或tomcat的  配置下,写个java小程序直接下载就行了。
      

  4.   

    在服务端写一个服务器 基于 socket,端口xxxx
    在客户端也用socket去connect xxxx端口 
      

  5.   

    还是自己还解决吧,我把方法和代码写到这里希望要以帮助其它有相同问题的朋友。首先下载一个ftp软件如serv-u ftp server,使用方法见:http://www.heibai.net/book/html/wangluogongju/qitaruanjian/2009/0626/618.html
    然后编写下载代码,如下:package com.panyang;import sun.net.ftp.FtpClient;
    import java.io.*;
    import sun.net.*;
    /**
     * 
     * @author panyang
     * Download temporary files from server to client
     *
     */
    public class FtpDownload {   static String ftpIP = "10.2.95.169";
      static String userName = "admin";
      static String passWord = "admin";
      
      public static void main(String[] args)     {         try         {             FtpClient fc=new FtpClient( ftpIP );             fc.login( userName , passWord );
                fc.binary();             int ch;             File fi = new File("d:\\config.rar");             RandomAccessFile getFile = new RandomAccessFile(fi,"rw");             getFile.seek(0);             TelnetInputStream fget=fc.get("config.rar");             DataInputStream puts = new DataInputStream(fget);             while ((ch = puts.read()) >= 0) {                 getFile.write(ch);             }             fget.close();             getFile.close();             fc.closeServer();         }         catch (IOException ex)         {                ex.printStackTrace();         }       }
    }