WebClient usage for Windows Phone development

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.