欢迎来到天天文库
浏览记录
ID:25211804
大小:45.25 KB
页数:39页
时间:2018-11-17
《javasocket传输图片》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、服务器端:Java代码收藏代码import;import;import;import;import;import;import;publicclassServerTest{intport=8821;voidstart(){Sockets=null;try{ServerSocketss=newServerSocket(port);while(true){//选择进行传输的文件StringfilePath="D:\update\image\";Filefi=newFile(filePath);("文件长度:"+(int)());//pub
2、licSocketaccept()throws服务器端:Java代码收藏代码import;import;import;import;import;import;import;publicclassServerTest{intport=8821;voidstart(){Sockets=null;try{ServerSocketss=newServerSocket(port);while(true){//选择进行传输的文件StringfilePath="D:\update\image\";Filefi=newFile(filePath);
3、("文件长度:"+(int)());//publicSocketaccept()throws服务器端:Java代码收藏代码import;import;import;import;import;import;import;publicclassServerTest{intport=8821;voidstart(){Sockets=null;try{ServerSocketss=newServerSocket(port);while(true){//选择进行传输的文件StringfilePath="D:\update\image\";Fi
4、lefi=newFile(filePath);("文件长度:"+(int)());//publicSocketaccept()throws服务器端:Java代码收藏代码import;import;import;import;import;import;import;publicclassServerTest{intport=8821;voidstart(){Sockets=null;try{ServerSocketss=newServerSocket(port);while(true){//选择进行传输的文件StringfilePath="
5、D:\update\image\";Filefi=newFile(filePath);("文件长度:"+(int)());//publicSocketaccept()throws服务器端:Java代码收藏代码import;import;import;import;import;import;import;publicclassServerTest{intport=8821;voidstart(){Sockets=null;try{ServerSocketss=newServerSocket(port);while(true){//选择
6、进行传输的文件StringfilePath="D:\update\image\";Filefi=newFile(filePath);("文件长度:"+(int)());//publicSocketaccept()throws服务器端:Java代码收藏代码import;import;import;import;import;import;import;publicclassServerTest{intport=8821;voidstart(){Sockets=null;try{ServerSocketss=newServerSocket
7、(port);while(true){//选择进行传输的文件StringfilePath="D:\update\image\";Filefi=newFile(filePath);("文件长度:"+(int)());//publicSocketaccept()throws服务器端:Java代码收藏代码import;import;import;import;import;import;import;publicclassServerTest{intport=8821;voidstart(){Sockets=null;try{ServerS
8、ocketss=newServerSocket(port);while(true){//选择进行传输的文件StringfilePath="D:\update\image\"
此文档下载收益归作者所有