Nolanamy
Nolanamy
2017-06-08 02:34

请问这段代码里URL类的程序集引用是什么,谢谢

  • c#

private Bitmap returnBitmap(String url) {
URL fileUrl = null;
Bitmap bitmap = null;

try {
    fileUrl = new URL(url);
} catch (MalformedURLException e) {
    e.printStackTrace();
}

try {
    HttpURLConnection conn = (HttpURLConnection) fileUrl
            .openConnection();
    conn.setDoInput(true);
    conn.connect();
    InputStream is = conn.getInputStream();
    bitmap = BitmapFactory.decodeStream(is);
    is.close();
} catch (IOException e) {
    e.printStackTrace();
}
return bitmap;

}

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答

为你推荐