C# 21., 21 C#., 2 ~ 3 21. 2 ~ 3 21.,. 1~ 2 (, ), C#.,,.,., 21..,.,,, 3. A..,,.,.. Q&A..
24 C#,.NET.,.,.,. Visual C# Visual Studio.NET,..,. CD., www. TeachYour sel f CSharp. com., ( )., C#.. C# 1, 1.
WEEK 1
26 Week 1 Day 2, C# C#.NET. Day 3, Day 4,, Day 5, C#.,. Day 6, Day 7,., C#. C#. C#.
DAY 1 C#
28 Week 1 C#? C#,., C#( ) 2000 6. C# ECMA. Anders Hej lsberg, Hej lsberg C+ + Delphi. C#. C#.,. C#,,. C# (OOP : Object- Oriented Programming).. Day 2, C#. C#?. J ava, C+ +, Perl, Microsoft Visual Basic. C# C C+ +,.. J ava. C#,.
Day 1 C# 29 C#. C#.. C#. C#. C#. C#. C#... C#,. C# C# J ava, C+ +,,, (virtual base class). C+ +., C#. C# C C+ +. C C+ + ( J ava), C#. C/ C+ +,,. C+ + : :,., -> 3 C# (. ).. Java Java, C#. Java., C# Java C++.
30 Week 1 C#?,,,. C#., 21 C#. (Pointer) C C++,. C#,.,. C#,,. C#. (Encapsulation), (Inheritance). (Polymorphism)... C#, C#. C#,,,. C# C# (Keyword). [ 1.1] C#.., C#.
Day 1 C# 3 1 [ 1.1] C# abstract as base bool break byte case catch char checked class const continue decimal default delegate do double else enum event explicit extern false finally fixed float for foreach goto if implicit in int interface internal is lock long namespace new null object operator out override params private protected public readonly ref return sbyte sealed short sizeof stackalloc static string struct switch this throw true try typeof uint ulong unchecked unsafe ushort using virtual void while, C#. get, set, value. C# C# (Class), (Member Method)... Day 2, Day 6.
32 Week 1 C# C#. C#,..NET. C#.,. Microsoft Bob,. C# Microsoft Bob. Microsoft Bob, C#, C#., C#. Microsoft.NET C#..NET..NET, C#..NET. C#,,,,. C# Visual Basic, C+ +, J ava. C#, 3.
Day 1 C# 33.NET Java C#? C#? C# C++? Visual Basic.Net C#? C# C+ +, Visual Basic.? C# Visual Basic 6, Visual Basic.NET( 7). Visual Basic.NET, C#. Visual Basic.NET C#. C# C+ +. C+ + C#,. C+ + C#. J ava. C+ + C# J ava C, J ava C#. C, C#, C+ +, J ava C., C.. C#....,.,.
34 Week 1,.,... C#( ). 1.. 2.. 3.. 4.. (1 ),..,.,.???.,. 1.,. 2.., r 2., (Program Development Cycle) 3 4..,.,
Day 1 C# 35.. (Source Code).., C#. Syst em. Consol e.wr i t eli ne ("Hel l o, Mom!" ) ; Hel l o, Mom! ( ). (Editor). C#, C#., C#.,. Visual Studio C# Visual C#.. Visual Studio.NET, C#. C#. Visual Studio.NET.,..,. C#..,. ed, ex, edit, emacs, vi.
36 Week 1.., -,, -.,.,..,. CodeWrite : CodeWrite ASP, XML, HTML, C#, Perl, Python.. http://www.premia.com EditPlus : EditPlus, HTML,.,. (Color- Coding).. http://www.editplus.com JEdit : JEdit Java., C#.,. http://jedit.sourceforge.net Poorman IDE by Duncan Chen : Poorman C# Visual Basic.NET,. Poorman IDE.. http://www.geocities.com/duncanchen/poormanide.htm SharpDevelop by Mike Krüger : SharpDevelop C# (free)..net, (Open Source Editor, GPL(General Public License)).. http://www.icsharpcode.net. C#.cs., C#.cs.
Day 1 C# 37 C#, C#. C#. C# (CLR ; Common Language Runtime). (Executable) C#, CLR CLR,.. (Port ability). C C+ +,., C,., C#.,. (machine language),... C C++. C#. (IL : Intermediate Language).,. CLR CLR C#. IL CLR., CLR IL., CLR.., IL.,.
38 Week 1 IL, C++., C++. C# Just In Time Jitting. C# IL C#., csc,., radius.cs. csc r adi us. cs (GDE),.,..., E,. IL.,.exe..exe ( ). CLR.. [ 1.1].
Day 1 C# 39 1.1 C# (IL). IL, C# -, -. 2 (EXE )., C#, ASP.NET.. IL,.,.,.,.. C# 1 :. C#.cs (, a_program.cs, database.cs ). 2 : C#.,.exe.dll., myprog.cs myprog.exe.. 1. 3 : CLR C#.., 1. [ 1.2].,.
40 Week 1! - -, (,, ). C# C#., [ 1.1].., C#,,. Hel l o, Wor l d! hello.cs..,. hello.cs [ 1.1]. (:). 1.2 C# 1 2?? 3
Day 1 C# 4 1 1.1 h ello.cs 1 : cl ass Hel l o 2 : { 3: st at i c voi d Mai n () 4: { 5: Syst em. Consol e.wr i t eli ne (" Hel l o, Wor l d!" ) ; 6: } 7: }.,, hello.cs. he llo.cs hello.cs. 1.. 2. [ 1.1]. (:).... C#,.. C C++. C C++, main()., C# Main() M. C# m,. 3.. hello.cs. 4. hello.cs. 5. hello.cs.,. csc hel l o. cs
42 Week 1 (IDE : Integrated Development Environment ),.,. 6...,., Console Consol, : hel l o. cs (5, 7) : er r or CS0117 : ' Syst em' does not cont ai n a def i ni t i on f or ' Consol ' 7., 2. hello.cs, [ 1.1], 3. 8. C#,. hello,. hel l o.cs : hel l o.exe : hello.cs 9. hello.exe hel l o. Hel l o, Wor l d!. hello,..,.,..,. ReadLine. 1 : cl as s Hel l o 2 : { 3 : st at i c voi d Mai n ()
Day 1 C# 43 4 : { 5 : Syst em. Consol e.wr i t eli ne (" Hel l o, Wor l d!" ) ; 6: Syst em. Consol e.readli ne () ; 7 : } 8 : }!,, C#, hello.cs.,., - Hello World -. ( ).,,.,.. hello.cs., hello.cs., 5. (;). hello.cs [ 1.2]. 1.2 h ello.cs 1: cl ass Hel l o 2 : { 3: st at i c voi d Mai n () 4: { 5: Syst em. Consol e.wr i t eli ne (" Hel l o, Wor l d!" ) 6: } 7: },...
44 Week 1,. csc hel l o. cs,.,. hel l o.cs (5, 48) : er r or CS1002 : ; expect ed,. hel l o.cs (5, 48) : 5 48 er r or CS1002 : ; expect ed, hello.cs 5 48,.,. C#,.........,. hello.cs. 1. 5 (; ). 2. hello (" )..,. hel l o.cs (5, 32) : er r or CS1010: Newl i ne i n Const ant
Day 1 C# 45 5. 5 32...,.,........ C#,.,,. = 2 r,.. C#.,.... r 2.,.. C#, C#..
46 Week 1 (Con sole applicat ion ) :.,.,. (Win dow s applicat ion ) : GUI (Graphical User Interface). (Web service s ) :. / ASP.NET (Web F orm/ ASP.NET applicat ion ) : ASP. NET,., C#,,. C#,., C#. C# ( )., - -.. C#.,.,..
Day 1 C# 47 Q&A Q. C#? A.. C# (CLR). CLR. CLR DLL. Q.,? A. C#.. hello. hello.exe. hello.cs, C#. C#. Q., (.cs)? A.,.,. (IDE : Integrated Development Environments) (.cs). (.cs),.,.. Q.? A...,.,.,.. C#. (Color- Coding),.
48 Week 1 Q.? A.,...,,.., ( )... A,. 1. C#. 2. IL CLR? 3.? 4. my_prog.cs? 5. C#? 6. filename.txt C#? 7.,.? 8.? 9.? my_pr og. cs (35, 6) : er r or CS1010 : Newl i ne i n const ant 10.? my_pr og. cs (35, 6) : er r or CS1010 : Newl i ne i n const ant
Day 1 C# 49 1. [ 1.1]. EXE ( )? 2. ( ).? 1 : / / ci r cl e. cs - (l i t er al ) 2 : / /. 3 : / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 4 : 5 : usi ng Syst em; 6: 7 : cl ass var i abl es 8 :{ 9: publ i c st at i c voi d Mai n () 10 : { 11 : / /. 12 : 13 : i nt r adi us = 4; 14 : const doubl e PI = 3. 14159; 15 : doubl e ci r cum, ar ea ; 16: 17 : / /. 18 : 19: area = PI * radi us * radius ; 20 : ci r cum = 2 *PI * r adi us ; 21 : 22 : / /. 23 : 24 : Consol e.wr i t eli ne (" = { 0 }, PI = { 1 }", r adi us, PI ) ; 25 : Consol e.wr i t eli ne (" : { 0 }", ar ea ) ; 26: Consol e.wr i t eli ne (" : { 0 }", ci r cum) ; 27 : } 28 : } 3..? 1 : cl ass ACl as s 2 : { 3 : st at i c voi d Mai n () 4 : { 5 : i nt x, y; 6: f or (x = 0; x < 10; x++, Syst em. Consol e.wr i t e ("\ n" ) ) 7 : f or (y = 0; y < 10; y++)
50 Week 1 8 : Syst em. Consol e.wr i t e (" X" ) ; 9: } 10: } 4. :.,.? 1 : cl as s Hel l o 2 : { 3 : st at i c voi d Mai n () 4 : { 5 : Syst em. Consol e.wr i t eli ne (!) ; 6: Syst em. Consol e.wr i t eli ne (!) ; 7 : } 8 : } 5. 3..? 8 : Syst em. Consol e.wr i t e ("{ 0 }", (char ) 1) ;