【发布时间】:2012-12-31 22:20:08
【问题描述】:
url = new URL("https://dl-web.dropbox.com/get/userlist.txt?w=c8bdbe4a");
Scanner s = new Scanner(url.openStream());
q=s.next();
if(me.equals(q))
{b=true; break;}
我收到此错误:
Exception in thread "main" java.io.IOException: Server returned HTTP response code: 403 for URL: https://dl-web.dropbox.com/get/userlist.txt?w=c8bdbe4a
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source)
at java.net.URL.openStream(Unknown Source)
at gui.main(gui.java:48)
有人知道为什么,或者如何解决这个问题吗?我正在尝试从在线文本文件中读取。
【问题讨论】:
-
因为您无权访问此资源...只需在浏览器中输入网址即可。
标签: java file url text runtime-error