如何用JAVA编程实现抓取某一页面的内容并保存成本地文件?
2个回答
2013-07-13
展开全部
import java.io.*;
import java.net.*;
public class server
{
public static void main(String[] args)
{
System.out.println("server starting.......");
try{
serversocket server=new serverSocker(7777);//listen7777port
Socket st=accpet();
BufferdReader br_net=new BufferdReader(new InputStreamReader)
BufferdReader br_key=new BufferdReader(new InputStreamReader)
printWriter pw=new PrintWriter(st.getOutputStream());
while(true){
String a=br_key.readLine();
pw.println(D:\);
pw.flush();
s=br_net.readLine();
system.out.println("hesays"+s);
}
}catch(Exception e){}
import java.net.*;
public class server
{
public static void main(String[] args)
{
System.out.println("server starting.......");
try{
serversocket server=new serverSocker(7777);//listen7777port
Socket st=accpet();
BufferdReader br_net=new BufferdReader(new InputStreamReader)
BufferdReader br_key=new BufferdReader(new InputStreamReader)
printWriter pw=new PrintWriter(st.getOutputStream());
while(true){
String a=br_key.readLine();
pw.println(D:\);
pw.flush();
s=br_net.readLine();
system.out.println("hesays"+s);
}
}catch(Exception e){}
2013-07-13
展开全部
file 类可以实现 大嘴哥 给我分吧
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询