First, the type conversion method commonly used by convert class
Convert.ToInt32 () to Integer (int)
Convert.tochar () converted to character type (char)
Convert.ToString () converted to string type (string)
Convert.todatetime () converted to date (datetime)
Convert.todouble () converted to double-precision floating-point type (double)
Conert.tosingle () converted to single-precision floating point (float)
Second, operator
Arithmetic operator +-*/%
Logical Operators & | ^ ~ && | | !
String Join operator +
Increment and decrement operator + +--
Shift Operators << >>
comparison operator = = = < > <= >=
Assignment operator = + = = *=/=%= |= ^= <<= >>=
Conditional operator (ternary operator)?:
Comparison of infrequently used but important operators:
The IS operator can check whether an object is compatible with a particular type.
The as operator is used to perform an explicit type conversion of a reference type.
Third, the Process Control statements
Control flow
if (bool) {}else{}
if (boll) else if (bool) else{}
Switch ()
{
Case:
Break
Default:
Break
}
Looping statements
for (int i==0;i<int;i++) {}
while (true) {}
Do{}while (True) loop
Traverse only
foreach (Tabelrow tr in datatabel.rows) {}
Four, ref/out/in three kinds of parameter types
In: The procedure does not overwrite the contents of in, but can be read, so you have to have a value before passing in. ----------------------------------Read-only
Out and out: The value passed in is not read by the procedure, but the procedure can be written, so the assignment before passing in is meaningless I do not read. -------------Write only
Ref: The value passed in, the procedure will read, and will be written. Because it reads, you have to have a value before you pass in. -----------------------------Read and Write
Three elements: Convert, operator, flow control statement, ref/out/in three types of parameters