Windows Phone 7 Study Notes-common gadgets (1)

Source: Internet
Author: User

I have been paying attention to WP 7 for a long time, and I have also read a good blog on the Internet. I have learned a lot from them. Record the learning process of the new technology and help others learn it together. The purpose of learning is "learning together and making progress together ";

 

Today I wrote two frequently-used gadgets to share with you.

 

Note: These two gadgets must use services provided by third parties.

 

Gadgets 1: Mobile Phone Number home location query.

The running result is as follows:

 

CodeAs follows:

 Private void Btnquery_click ( Object Sender, Routedeventargs E) {client. getmobilecodeinfocompleted + = New  Eventhandler <Mobile. Getmobilecodeinfocompletedeventargs > (Client_getmobilecodeinfocompleted); progressbar. Visibility = system. Windows. Visibility . Visible; If (Tbphone. Text! = "" ) {Client. getmobilecodeinfoasync (tbphone. Text, "" );} Else { MessageBox . Show ( "The phone number cannot be blank! " , "Prompt" , Messageboxbutton . OK );}}Void Client_getmobilecodeinfocompleted ( Object Sender, mobile. Getmobilecodeinfocompletedeventargs E ){ If (E. Error = Null ) {Tbdisplayaddress. Text = E. Result ;}}

Gadgets 2: Zip code query.

The running result is as follows:

 

The Code is as follows:

 Void Btnquery_click ( Object Sender, Routedeventargs E) {client. getaddressbyzipcodecompleted + =New  Eventhandler <Chinazip. Getaddressbyzipcodecompletedeventargs > (Client_getaddressbyzipcodecompleted ); If (Txtpostcode. Text = "" ) {Txtaddress. Text = "No data is connected! " ;} Else {Client. getaddressbyzipcodeasync (txtpostcode. Text, "" );}} Void Client_getaddressbyzipcodecompleted ( Object Sender, chinazip. Getaddressbyzipcodecompletedeventargs E ){ If (E. Error = Null ) {Txtaddress. Text = E. Result. nodes [0]. value. tostring ();}}

Very simple, two smallProgramThe code is very simple.

The program is only used for learning and not for commercial applications.

I originally wanted to upload the code, but there is a problem with SkyDrive upload.

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.