Focus: 1, enter cast int b=convert.toint32 (Consloe,readline ()), 2, Judge Leap Year if (a%400==0| | A%4==0 && a%100!=0) 3, stochastic generator random rand=new random (); Int D=rand. Next (3); {Randomly generate a number not exceeding three} example: static void Main (string[] args) {string[]cellphone=new string[] {"122321341", "12453145", " 18234287234 "," 14420408420 "," 14234243481 "," 14234324 "," 1434234324 "," 321114221 "," 321111212 "}random rand=new Random ( ); for (int i=0;i<50;i++) {//Slows down some System.Threading.Thread.Sleep (100);//randomly generates array subscript int Sub=rand. Next (cellphone. LENGTH);//The element value of the array according to the subscript string s=cellphone[sub];//display console.clear (); Console.WriteLine (s);}} 4, Cycle (small 99) apply the exhaustive (there are three kinds of shares of the coins 1 minutes 3 minutes 5 points together to buy 1.5 yuan of the chickens of how many combinations (number and kind) and iteration (5 of the first 100 items of the number and) 5, traversing the array foreach (int m in a) Consloe.writeline ("Times The "+m" 6, Object class class N=new object P=new Object object. The Field object. Method ("") Encapsulates (heart, mind, not accept) member field (privaty) lowercase Start method (string name) property (set{this . Name=value;} Get{return}) Capitalize the beginning of the access level public privaty (only own member access) this. Self-class stuff reflector anti-compiler 7,//First step: Connect to Database SqlConnection conn=new SqlConnection ("server=.; Database=data1220;user=sa;pwD= ") Conn. Open ();//second part: Write execution Statement SqlCommand Cmd=conn. CreateCommand (); cmd. commandtext= "Select*from Users where Uname= '" +username+ "' and upass= '" +upass+ "'";//Read SqlDataReader dr=cmd. ExecuteReader (); if (Dr. Read ()) {MessageBox.Show (dr["uname"). ToString ());} Conn. Close ();
Finishing essay!!!