String apikey = "111111111111111111111111111111"; <br/> string isbnurl = "http://api.douban.com/book/subject/isbn/"; </P> <p> Public static void main (string [] ARGs) throws exception {<br/> // requesturl = isbnurl + isbnno + "? Apikey = "+ apikey; <br/> // eg: http://api.douban.com/book/subject/isbn/9787111298854? Apikey = 111111111111111111114 <br/> ISBN isbntest = New ISBN (); <br/> string isbnno = "9787111298854"; <br/> string xml = isbntest. fetchbookinfobyxml (isbnno); <br/> system. out. println (XML); <br/>}</P> <p>/** <br/> * obtain data from Douban according to ISBN. You have applied for an apikey. A maximum of 40 requests per minute are required. <Br/> * @ Param isbnno <br/> * @ return <br/> * @ throws ioexception <br/> */<br/> Public String fetchbookinfobyxml (string isbnno) throws ioexception {<br/> string requesturl = isbnurl + isbnno + "? Apikey = "+ apikey; <br/> URL url = new URL (requesturl); <br/> urlconnection conn = URL. openconnection (); <br/> inputstream is = Conn. getinputstream (); <br/> inputstreamreader ISR = new inputstreamreader (is, "UTF-8"); <br/> bufferedreader BR = new bufferedreader (ISR ); <br/> stringbuilder sb = new stringbuilder (); </P> <p> string line = NULL; <br/> while (line = BR. readline ())! = NULL) {<br/> Sb. append (line); <br/>}</P> <p> Br. close (); <br/> return sb. tostring (); <br/>}