首先从客户端把文件名传到服务器端,在服务器端用File类的方法list()获得文件列表。首先返回文件列表长度,再依次返回文件列表,在客户端,收到长度后,用for循环控制接收文件列表即可。
client:
count = Integer.parseInt(temp1);
fileText.setText("");
for (int i=0;i<count;i++)
fileText.append(in.readLine()+"\n");
client:
count = Integer.parseInt(temp1);
fileText.setText("");
for (int i=0;i<count;i++)
fileText.append(in.readLine()+"\n");
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货