比较简单,主要是以备后用
import java.io.FileOutputStream;
import java.io.IOException;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.util.EntityUtils;
public class Connect {
public static void xlsxz() throws ClientProtocolException, IOException {
//1,导包
//2,得到HttpClient对象
HttpClient client = new DefaultHttpClient();
//3,设置请求方式
HttpGet get = new HttpGet("http://stock.gtimg.cn/data/get_hs_xls.php?id=ranka&type=1&metric=chr");
//4,执行请求, 获取响应信息
HttpResponse response = client.execute(get);
if(resp