Learning purpose: Master the basic knowledge of C#
1. Define variables:
string strExample; string("aaa")
char chrExample; character('a')
bool blnExample; Bool type (true/false)
DataTime datExample; date type ("09/19/2002")
int intExample; integer (32-bit signed integer)
double dblExample; floating point number (64-bit double precision floating point number)
2. Various operations:
= assignment operation
+ addition operation
- Subtraction operation
* Multiplication operation
/ division operation
% Modulo operation
&& Logical And
|| Logical Or
! LogicNot
3. Various structures:
if(condition)
{
}
else
{
}
switch(condition)
{
case option1:
break;
case option2:
break;
}
for(int i=1;i<=10;i++)//Pay special attention to the semicolon inside
{
}
while(condition)
{
}
do
{
}while(condition);
4. Things to note:
1. People who are used to VB can easily miss the semicolon at the end of the statement;
2. People who are accustomed to VB use variables casually without declaring them, which is not allowed by default in C#;
3. Use parentheses when passing parameters to the function: Response.Write "aa"; is not allowed.
What I'm talking about can hardly be called speaking a language. Learning a language requires not only learning grammar, but also learning language features. I hope you will buy a C# book when you have time to study C# as a tool. A feature of a new language. That’s it for today, let’s talk about WEB controls tomorrow.