Customer applications for the 10.6.3 class library
The new project is named Ch10cardclient. Add a reference to the class Library project Ch10cardlib. The code is as follows:
usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingSystem.Threading.Tasks;usingCh10cardlib;namespacech01cardclient{classProgram {Static voidMain (string[] args) {Deck Mydeck=NewDeck (); Mydeck.shuffle (); for(inti =0; I < the; i++) {Card Tempcard=Mydeck.getcard (i); Console.Write (Tempcard.tostring ()); if(I! =Wuyi) Console.Write (", "); ElseConsole.WriteLine (); } console.readkey (); } }}
The results are as follows:
52 cards are randomly placed. The following chapters will continue to develop and use this class library.
(original) C # learning note 10--Defining Class Members 06--sample application 03--client applications for class libraries