| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1862 人关注过本帖
标题:java代码中有一处错误,求修复。
只看楼主 加入收藏
yuma
Rank: 12Rank: 12Rank: 12
来 自:银河系
等 级:贵宾
威 望:37
帖 子:1934
专家分:3012
注 册:2009-12-22
结帖率:89.13%
收藏
已结贴  问题点数:20 回复次数:2 
java代码中有一处错误,求修复。
javac命令编译的时候,出现一处错误:
JMyFtpClient.java:89: 错误: 解析时已到达文件结尾
    }
     ^
1 个错误

求修复.


程序代码:
import *;

import *;

import java.util.*;


public class JMyFtpClient {
    /*Members*/
private FTPClientDrv m_FtpClient;

    /**
     *
     */
    public JMyFtpClient() {
        super();
        // TODO Auto-generated constructor stub   
        m_FtpClient = null;
    }

    public static void main(String[] args)
        throws ClassNotFoundException, IOException {
        System.out.println("JMyFtpClient Started");

        JMyFtpClient ftp = new JMyFtpClient();

        if (false == ftp.Open("172.16.64.21", 21, "application", "application")) {
            System.out.println("OpenFail");

            return;
        }

        if (false == ftp.DownloadDirectory("/appl/Tmpww", "C:\\TmpWw\\Down")) {
            trace("download Fail");
        }

        /*      if ( false == ftp.UploadDirectory( "C:\\TmpWw" , "/appl/Tmpww") )
                    trace( "Uplaod Directpry Fail" );
                else
                    trace( "Upload Directory Success" );
        */

        /*      for ( int i=0; i < 0; i++ )
                {

                    int nByteDown = ftp.DownloadFile( "appl/3.txt" , "c:\\TmpWw\\Temp\\12" + i + ".txt" );
                    if ( nByteDown <= 0 )
                        System.out.println( "Download File Fail" );
                    else
                        trace( "Download File Success" );


                    int nByteUp = ftp.UploadFile( "C:\\TmpWw\\1.txt" , "appl/Tmp/Tmp2/1" + i + ".txt" );
                    if ( nByteUp <= 0 )
                        System.out.println( "Upload File Fail" );
                    else
                        trace( "Upload File Success" );
                }
        */
        ftp.Close();

        System.out.println("JMyFtpClient Stopped");
    }

    /*Open Connection*/
    public boolean Open(String strServIPAddr, int nServPort,
        String strUserName, String strPassword) {
        try {
            m_FtpClient = new FTPClientDrv(strServIPAddr, nServPort); //Connect to Server

            m_FtpClient.login(strUserName, strPassword);

            m_FtpClient.setType(new FTPTransferType());
        } catch (IOException e) {
            trace("Open Ftp Server Fail, IOException");
            e.printStackTrace();

            return false;
        } catch (FTPException e) {
            trace("Open Ftp server Fail, Ftp Exception");
            e.printStackTrace();

            return false;
        }

        trace("Login FTP Server Ok");

        return true;
    }
搜索更多相关主题的帖子: out 错误 false java ftp 
2020-07-15 10:24
双子座私语
Rank: 3Rank: 3
等 级:论坛游侠
威 望:3
帖 子:19
专家分:141
注 册:2020-5-6
收藏
得分:20 
有问题,你把问题日志跟代码贴出来啊,不然没人回你的
2020-07-17 14:51
疯狂的小a
Rank: 10Rank: 10Rank: 10
等 级:贵宾
威 望:39
帖 子:423
专家分:1871
注 册:2018-2-6
收藏
得分:0 
以下是引用yuma在2020-7-15 10:24:46的发言:

javac命令编译的时候,出现一处错误:
JMyFtpClient.java:89: 错误: 解析时已到达文件结尾
    }
     ^
1 个错误

求修复.


import *;

import *;

import java.util.*;


public class JMyFtpClient {
    /*Members*/
private FTPClientDrv m_FtpClient;

    /**
     *
     */
    public JMyFtpClient() {
        super();
        // TODO Auto-generated constructor stub   
        m_FtpClient = null;
    }

    public static void main(String[] args)
        throws ClassNotFoundException, IOException {
        System.out.println("JMyFtpClient Started");

        JMyFtpClient ftp = new JMyFtpClient();

        if (false == ftp.Open("172.16.64.21", 21, "application", "application")) {
            System.out.println("OpenFail");

            return;
        }

        if (false == ftp.DownloadDirectory("/appl/Tmpww", "C:\\TmpWw\\Down")) {
            trace("download Fail");
        }

        /*      if ( false == ftp.UploadDirectory( "C:\\TmpWw" , "/appl/Tmpww") )
                    trace( "Uplaod Directpry Fail" );
                else
                    trace( "Upload Directory Success" );
        */

        /*      for ( int i=0; i < 0; i++ )
                {

                    int nByteDown = ftp.DownloadFile( "appl/3.txt" , "c:\\TmpWw\\Temp\\12" + i + ".txt" );
                    if ( nByteDown <= 0 )
                        System.out.println( "Download File Fail" );
                    else
                        trace( "Download File Success" );


                    int nByteUp = ftp.UploadFile( "C:\\TmpWw\\1.txt" , "appl/Tmp/Tmp2/1" + i + ".txt" );
                    if ( nByteUp <= 0 )
                        System.out.println( "Upload File Fail" );
                    else
                        trace( "Upload File Success" );
                }
        */
        ftp.Close();

        System.out.println("JMyFtpClient Stopped");
    }

    /*Open Connection*/
    public boolean Open(String strServIPAddr, int nServPort,
        String strUserName, String strPassword) {
        try {
            m_FtpClient = new FTPClientDrv(strServIPAddr, nServPort); //Connect to Server

            m_FtpClient.login(strUserName, strPassword);

            m_FtpClient.setType(new FTPTransferType());
        } catch (IOException e) {
            trace("Open Ftp Server Fail, IOException");
            e.printStackTrace();

            return false;
        } catch (FTPException e) {
            trace("Open Ftp server Fail, Ftp Exception");
            e.printStackTrace();

            return false;
        }

        trace("Login FTP Server Ok");

        return true;
    }

}

假如人生没有梦想,和咸鱼有什么区别!
2022-08-05 14:24
快速回复:java代码中有一处错误,求修复。
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.038386 second(s), 10 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved