close

We need to use URLConnection class or HttpURLConnection class to set cookie.

The example is as below:

try

{

URL url = new URL("http://www.xxx.com");

URLConnection urlc =  url.openConnection();

 urlc.setRequestProperty("User-agent", "IE/6.0");
 String str;
while(()!=null)
{
System.out.println(str);


}

catch(IOException e)

{

System.out.println(e);


arrow
arrow
    全站熱搜
    創作者介紹
    創作者 JerryCheng 的頭像
    JerryCheng

    KwCheng's blog

    JerryCheng 發表在 痞客邦 留言(0) 人氣()