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.