有些服务器会拒绝java程序的访问,添加上一个浏览器信息即可骗过
?
connection.setRequestProperty("User-Agent",?"Mozilla/4.0?(compatible;?MSIE?5.0;?Windows?NT;?DigExt)");