您好,欢迎访问三七文档
当前位置:首页 > 办公文档 > 其它办公文档 > 计算机网络课程设计JAVA实现FTP客户端
1河南理工大学计算机科学与技术学院课程设计报告2015—2016学年第一学期课程名称计算机网络设计题目FTP客户端的设计与实现姓名****学号361309010410专业班级计科合1304指导教师孟慧2016年1月9日2目录第一章序言·················································································································21.1课程设计题目····················································································31.2开发工具·························································································3第二章系统需求分析·······························································································52.1功能需求·························································································52.2系统模型设计···················································································52.3系统工作流程设计·············································································5第三章系统设计·········································································································63.1实现功能·························································································63.2函数说明·························································································63.2.1界面设计代码······················································································63.2.2功能实现函数······················································································9第四章系统实现·······································································································134.1界面设计的实现················································································134.1.1连接服务器····························································································134.1.2获取文件列表·························································································134.1.3断开服务器····························································································144.1.4上传文件·······························································································154.1.5下载·····································································································164.1.6重命名··································································································184.1.7删除·····································································································194.1.8刷新·····································································································204.1.9返回上一目录·························································································214.1.10查看日志信息·······················································································21第五章总结···············································································································22第六章参考文献·······································································································233第一章序言1.1课程设计题目FTP(FileTransferProtocol,FTP)是TCP/IP网络上两台计算机传送文件的协议,FTP是在TCP/IP网络和INTERNET上最早使用的协议之一,它属于网络协议组的应用层。FTP客户机可以给服务器发出命令来下载文件,上载文件,创建或改变服务器上的目录。FTP是一个8位的客户端-服务器协议,能操作任何类型的文件而不需要进一步处理,就像MIME或Unencode一样。但是,FTP有着极高的延时,这意味着,从开始请求到第一次接收需求数据之间的时间会非常长,并且不时的必需执行一些冗长的登陆进程。FTP服务一般运行在20和21两个端口。端口20用于在客户端和服务器之间传输数据流,而端口21用于传输控制流,并且是命令通向ftp服务器的进口。当数据通过数据流传输时,控制流处于空闲状态。而当控制流空闲很长时间后,客户端的防火墙会将其会话置为超时,这样当大量数据通过防火墙时,会产生一些问题。此时,虽然文件可以成功的传输,但因为控制会话会被防火墙断开,传输会产生一些错误。FTP客户端主要目标是:促进文件的共享(计算机程序或数据);鼓励间接或者隐式的使用远程计算机;向用户屏蔽不同主机中各种文件存储系统的细节;可靠和高效的传输数据。1.2开发工具随着程序设计技术的改革和计算机环境的改变,Java语言也得到了迅速发展。一方面,C++等面向对象程序设计语言的发展为Java提供了基础。事实上,Java也大量继承了C以及C++的成果,并增加了体现程序设计发展状态的功能。另一方面,网络及Internet的发展对程序设计提出了新的要求,为Java的发展注入了强大的动力。正是Internet的快速发展和普及,改变了传统的计算模式,促进了Java的普及与流行。它最初被命名为Oak,目标设定在家用电器等小型系统的编程语言,来解决诸如电视机、电话、闹钟、烤面包机等家用电器的控制和通讯问题。由于这些智能化家电的市场需求没有预期的高,Sun放弃了该项计划。就在Oak几近失败之时,随着互联网的发展,Sun看到了Oak在计算机网络上的广阔应用前景,于是改造了Oak,以“Java”的名称正式发布。Java编程语言的风格十分接近C、C++语言。Java是一个纯的面向对象的程序设计语言,它继承了C++语言面向对象技术的核心,Java舍弃了C++语言中容易引起错误的指针(以引用取代)、运算符重载(operatoroverloading)、多重继承(以接口取代)等特性,增加了垃圾回收器功能用于回收不再被引用的对象所占据的内存空间,使得程序员不用再为内存管理而担忧。在JavaSE1.5版本中,Java又引入了泛型编程(GenericProgramming)、类型安全的枚举、不定长参数和自动装/拆箱等语言特性。Java不同于一般的编译执行计算机语言和解释执行计算机语言。它首先将源代码编译成二进制字节码(bytecode),然后4依赖各种不同平台上的虚拟机来解释执行字节码,从而实现了“一次编译、到处执行”的跨平台特性。不过,每次的编译执行需要消耗一定的时间,这同时也在一定程度上降低了Java程序的运行效率。但在J2SE1.4.2发布后,Java的执行速度有了大幅提升。与传统程序不同,Sun公司在推出Java之际就将其作为一种开放的技术。全球数以万计的Java开发公司被要求所设计的Java软件必须相互兼容。“Java语言靠群体的力量而非公司的力量”是Sun公司的口号之一,并获得了广大软件开发商的认同。这与微软公司所倡导的注重精英和封闭式的模式完全不同。Java编程语言的主要特性是个简单、面向对象、分布式、解释性、健壮、安全与系统无关、可移植、高性能、多线程和动态的语言。5第二章系统需求分析2.1功能需求1.实现一个图形用户界面的FTP客户端,保证文件的安全传输和存储。2.通过输入服务器地址、用户名和密码、可以实现远程FTP主机的登录。3.提供本地文件的上传功能,可对FTP主机文件进行下载、上传、删除、重命名等文件操作。4.可以查看一系列的操作的日志信息。2.2系统模型设计FTP的基本模型2.3系统工作流程设计控制进程数据传送进程用户接口命令与应答控制连接数据连接文件传输数据传送进程控制进程服务器客户端客户端用户登录登录验证操作内容列表查看文件列表连接成功至服务器端上传文件重命名文件上翻文件列表删除文件下翻文件列表下载文件文件管理连接失败退出6第三章系统设计3.1实现功能1.用户登陆、用户退出、文件上传、文件下载、文件重命名2.文件删除、上翻文件目录、下翻文件目录3.界面实现部分:设计为一个用户界面,上面包括各种用户按钮、文本输入栏、状态栏等等。具体如下:服务器地址信息输入栏、端口信息输入栏、用户名、密码输入栏、用户登陆(连接)按钮、用户退出(断开连接)按钮、服务器文件显示列表框、下载文件按钮、上传文件按钮、重命名文件按钮、删除文件按钮、上一级目录按钮,下一级目录按钮,状态栏。3.2函数说明3.2.1界面设计代码每个按钮对象注册监听器对应相关的业务逻辑,调用FtpBean类中的对应方法。下面是页面部分实现的主要代码以及相关说明:packageftp;importjava.awt.event.*;importjava.awt.*;impo
本文标题:计算机网络课程设计JAVA实现FTP客户端
链接地址:https://www.777doc.com/doc-4308427 .html