M*D
2 楼
最初的印象是各种娱乐新闻关于她的奇装异服,
觉得这人有特殊癖好,矫揉造作,绝不是我喜欢的那种。
从没想过去听她的歌,或刻意地去寻找她的什么。
可昨晚无聊,听了一首Bad Romance,现在是越来越喜欢了。
觉得这人有特殊癖好,矫揉造作,绝不是我喜欢的那种。
从没想过去听她的歌,或刻意地去寻找她的什么。
可昨晚无聊,听了一首Bad Romance,现在是越来越喜欢了。
m*n
3 楼
大家一般都去哪呀?
W*t
4 楼
从书上抄的CODE。
import java.io.InputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
import java.util.Scanner;
public class URLTester
{
public static void main(String[] args) throws IOException
{
String urlString;
if(args.length == 1)
urlString = args[0];
else
{
System.out.println("Wrong URL!");
return;
}
URL u = new URL(urlString);
URLConnection con = u.openConnection();
HttpURLConnection httpCon = (HttpURLConnection)con;
int code = httpCon.getResponseCode();
String message = httpCon.getResponseMessage();
System.out.println(code+ " "+ message);
if(code != HttpURLConnection.HTTP_OK)
{
System.out.println("Bad URL Connection!");
return;
}
InputStream inStream = con.getInputStream();
Scanner in = new Scanner(inStream);
while(in.hasNextLine())
{
String input = in.nextLine();
System.out.println(input);
}
}
}
有的网页能运行,没有问题。 有网页显示完SOURCE CODE 以后程序没法结束。
TERMINAL 光标一直闪,回不到提示符下。比如以下网页:
http://www.amazon.com/Crucial-2-5-Inch-adapter-Internal-CT120M5
不知道是怎么回事, 哪位能解释一下。多谢了。
import java.io.InputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
import java.util.Scanner;
public class URLTester
{
public static void main(String[] args) throws IOException
{
String urlString;
if(args.length == 1)
urlString = args[0];
else
{
System.out.println("Wrong URL!");
return;
}
URL u = new URL(urlString);
URLConnection con = u.openConnection();
HttpURLConnection httpCon = (HttpURLConnection)con;
int code = httpCon.getResponseCode();
String message = httpCon.getResponseMessage();
System.out.println(code+ " "+ message);
if(code != HttpURLConnection.HTTP_OK)
{
System.out.println("Bad URL Connection!");
return;
}
InputStream inStream = con.getInputStream();
Scanner in = new Scanner(inStream);
while(in.hasNextLine())
{
String input = in.nextLine();
System.out.println(input);
}
}
}
有的网页能运行,没有问题。 有网页显示完SOURCE CODE 以后程序没法结束。
TERMINAL 光标一直闪,回不到提示符下。比如以下网页:
http://www.amazon.com/Crucial-2-5-Inch-adapter-Internal-CT120M5
不知道是怎么回事, 哪位能解释一下。多谢了。
g*l
5 楼
顶一下
s*s
15 楼
来一首抒情的gaga - speechless
相关阅读
编译Tomcat真是恶梦JSP的一个问题[转载] Java 1.5 Generic 问题想用java编个画图的界面,哪位帮一下忙what wrong with jboss?JAWA on winXP 可以用Java 做机器人吗?Re: java.lang.reflect.InvocationTargetEx[转载] 谁能说说这两道Amazon的面试题The most popular java forum in china?How can I get Source code for servlet.jar 有没有java clustering的书或资料推荐?Jboss并发访问问题LIGHTWEIGHT_RENDERER in all-java JMF.Java GUI Testingwhere to get mock? Re: 考SCEA归来Re: 文件读入的问题如何在网页里得知浏览器使用什么JAVA虚拟机?[转载] Questions on failover & Hot deploymentOCEF海外教育基金会寻找义工System Administrator