This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
. Main
" .
"
--- Main.
Main.
. Main M
.
Hello World
Hello World
IntelliSense
Program.cs Main
Enter ---}---
. Console .
C Console
IntelliSense
. #C
.
Console
IntelliSense Con .
Tab Console
Enter .
static void Main(string[ ] args)
}
Console
.
Console . IntelliSense
. Console
WriteLine Enter .
, W r , i , t , e,
L WriteLine
Enter .IntelliSense
WriteLine
: Main.
www.ParsBook.org
}
---(--- . IntelliSense .
WriteLine
WriteLine .
overloaded Console WriteLine
. ---
WriteLine
.
(
. Build
Solution
Visual Studio 2008 Professional Edition Visual Studio 2008
Standard Edition
.
Visual C# 2008 Express
Edition
File Save
All
Visual C# 2008 Express Edition
Options
. Start Without
Debugging Debug
Hello
World.
:
”. . . Press any key to
continue“
.
Start
Debugging Debug
.
Enter
.
.
Show
All ) solution(TextHello Solution
Explorer
Files Solution
Explorer ---
.Solution Explorer
.
Microsoft Press\Visual CSharp Step
by) obj bin
Step\Chapter
1\TextHello\TextHello).
Solution Explorer
(+) bin .
Debug .
. Release
. Debug (+) Solution
Explorer
TextHello.exe TextHello.pdb TextHello.vshost.exeTextHello.vshost.exe.manifest
:
Visual C# 2008 Express
Edition
.
Start
Without TextHello.exe
Debugging Debug .
.
)Namespace(
.
.
.
.
.
(
).
)(
.
) (
.
)Namespace(
.
.
: TextHello
namespace TextHello
.
.
NET.) SDK(
NET.
. System Console .
. System.Console
SystemConsole
.
. using
www.ParsBook.org
TextHello Program.cs
:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
.) ( using
.
. using
using
.
.
using Program.cs
:
//using System;
Build . Build
Solution
: ) Error
List(
The name ’Console’ does not exist in the current context.
. ) Error
List(
. Program.cs
System.Console Main
: Main.
static void Main(string[] args)
System
IntelliSense
. Build Solution Build
.
class namespace using .
.
.
true protected in do abstract
try public int double as
typeof readonly interface else base
uint ref internal enum bool
ulong return is event break
unchecked sbyte lock explicit byte
unsafe sealed long extern case
ushort short namespace false catch
using sizeof new finally char
virtual stackalloc null fixed checked
void static object float class
volatile string operator for const
while struct out foreach continue
switch override goto decimal
this params if default
throw private implicit delegate
.
.
C#
.
yield select join from
set let get
value orderby group
where partial into
.
.
.
.
cost
.
cost
.
.
:
.
.
MyVariable myVariable
.
.
.
.
(
) forPrintOfText:.
. )(
!) )(
www.ParsBook.org
)CLS( .
NET.
.
#C.
)integer( ---
.
.
. )integer/ ( int age
- .
int age;
#C int
integer/
. (
. )
#C
.
.
.
. . age
age = 42;
(=)
age .
:
)ScreenTip(
.
C# )primitive data
types ( .
#C
int
31 2
324 100.5
coin = 0.42M;
char grill;
grill = ‘x’;
teeth = false;
www.ParsBook.org
++CC .
. #C.
:
PrimitiveDataTypes #C
.
Visual Studio 2008 Standard Edition Visual Studio
2008 Professional Edition
Microsoft Press\Visual CSharp Step by Step\Chapter
2\PrimitiveDataTypes\
Documents
.
PrimitiveDataTypes
. Open
Solution Explorer ) (
PrimitiveDataTypes
.
.PrimitiveDataTypes.sln sln.
.csproj. .
.
Debug
:
Sample value ”forty two“
.
. )(int
Sample
value
. int
booldouble .
.
Quit .