This topic has been archived. It cannot be replied.
-
工作学习 / IT技术讨论 / Java net 问题public void retrievePage( String urlStr, File savedFile ) throws Exception
{
.............
HttpURLConnection urlConn = (HttpURLConnection) url.openConnection();
int contentLen = urlConn.getContentLength();
....................
}
contentLen always returns me -1, which means I guess the conection isn't built up properyly. Why? I wrote similiar programs before, and they worked very well.
In addition, I use Sympetico to access Internet, does it matter?
Thanks in advance.
-fatbean(青年发明家:零零发);
2004-8-14
{493}
(#1841961@0)