C # FAQ Collection

Function method

1. Random Number

1. Create an instance of a random number Random, operation for generating two numbers

            Random Random Number Name = new Random ();

Reference Methods int a = r.Next (100); // [0,100)

int b = r.Next(100);//[0,100)

For otherwise use to change the value of the random number will not change. (Defining a function outside the loop in which a random variable)

2. Method 4: foreach loop

// foreach Tab twice this type fragment.

            foreach (array type variable names in an array of name)

            {

                  Console.WriteLine (variable names);

            }

3. VS-2017 Notes shortcut

1. Comment

ctrl+k, ctrl+c

2. Uncomment

ctrl+k,ctrl+u

4. Move the trimming code

  1) adjusting line: Hold down the Alt key while pressing the up or down arrow keys to adjust the sequential code

  2) while moving a plurality of rows:

        a) Hold down the Shift + Alt and press the upper or lower multiple selections, there are generated vertical lines;

        b) then only release the Shift key, press the down arrow keys to move a plurality of rows.

Guess you like

Origin www.cnblogs.com/winward996/p/11502380.html