就是这句:
import com.smart.net.utils.NetTool;
难道是因为我还有什么包没安装吗?

解决方案 »

  1.   

    这个是3方开发的包么?是的话工程中要导入这个jar。看样子sdk里没有,肯定是没有加入到工程中。
      

  2.   

    网上找的package com.smart.net.utils;
    import java.io.ByteArrayOutputStream;
    import java.io.File;
    import java.io.FileOutputStream;
    import java.io.InputStream;
    import java.net.HttpURLConnection;
    import java.net.URL;public class NetTool {
    /**
      * 获得url代码数据
      * */public static String getHtml(String path,String encoding) throws Exception {
      URL url = new URL(path);
      HttpURLConnection conn = (HttpURLConnection) url.openConnection();
      conn.setRequestMethod("GET");
      conn.setConnectTimeout(6 * 1000);
      // 别超过10秒。
      System.out.println(conn.getResponseCode());
      if(conn.getResponseCode()==200){
       InputStream inputStream=conn.getInputStream();
       byte[] data=readStream(inputStream);
       return new String(data,encoding);
      }
      return null;
    }/**
    * 获取指定路径,的数据。

    * **/
    public static byte[] getImage(String urlpath) throws Exception {
      URL url = new URL(urlpath);
      HttpURLConnection conn = (HttpURLConnection) url.openConnection();
      conn.setRequestMethod("GET");
      conn.setConnectTimeout(6 * 1000);
      // 别超过10秒。
      if(conn.getResponseCode()==200){
       InputStream inputStream=conn.getInputStream();
       return readStream(inputStream);
      }
      return null;
    }/**
      * 读取数据 
      * 输入流
      * 
      * */
    public static byte[] readStream(InputStream inStream) throws Exception {
      ByteArrayOutputStream outstream=new ByteArrayOutputStream();
      byte[] buffer=new byte[1024];
      int len=-1;
      while((len=inStream.read(buffer)) !=-1){
       outstream.write(buffer, 0, len);
      }
      outstream.close();
      inStream.close();
      
    return outstream.toByteArray();
    }
    }
      

  3.   

    ...那就不好办了,
    http://www.cnblogs.com/llb988/archive/2011/02/11/1951693.html
    你看的是不是这个啊,那应该是人家自己写的demo里的一个类。应该不是系统的,你自己看看是用了这类里什么方法,不行自己写个呗