Note:
For personal use, WebClient usage has many similarities with WebService access. The difference is that WebService requires a local web reference, but WebClient does not. In addition, WebClient is easier to change the accessed URL.
For example, access is as follows:
String url = "http://www.youdao.com/smartresult-xml/search.s? Jsflag = true & type = Mobile & Q = "+ phone. text. trim (). tostring (); WebClient client = new WebClient (); client. downloadstringcompleted + = new downloadstringcompletedeventhandler (client_downloadstringcompleted); client. downloadstringasync (New uri (URL, urikind. absolute); void client_downloadstringcompleted (Object sender, downloadstringcompletedeventargs e ){}
CodeNote:
The URL is a Web interface used to query the home location by phone number.
Because the phone number is dynamically changing, it is more convenient to use WebClient.
Here, I found some interfaces for phone number attribution query, but they are all in GBK encoding format. WP cannot identify GBK encoding, so Chinese characters may be garbled.
Phone number attribution query:
Http://www.hujuntao.com/archives/phone-numbers-attribution-to-api-interface.html