Visual C 2008 Express IDE http www microsoft

  • Slides: 40
Download presentation

Visual C# 2008 Express IDE • 官方網站 http: //www. microsoft. com/express/vcsharp/ • 善用線上資源 –

Visual C# 2008 Express IDE • 官方網站 http: //www. microsoft. com/express/vcsharp/ • 善用線上資源 – Introduction to Visual C# 2008 Video – Beginner Developer Learning Center – Visual C# team’s blogs – Visual C# Express Forum 4

第 1支C#應用程式 using System; System. Collections. Generic; System. Linq; System. Text; namespace Hello {

第 1支C#應用程式 using System; System. Collections. Generic; System. Linq; System. Text; namespace Hello { class Program{ static void Main(string[] args) { Console. Write. Line("Hello!"); } } } 6

. NET 架構 VB. NET C# C++ 原始碼 (Source Code) 建置 (Build) CIL (.

. NET 架構 VB. NET C# C++ 原始碼 (Source Code) 建置 (Build) CIL (. exe, . dll, etc. ) 共同中介語言 (Common Intermediate Language) 碼集(Package) 偵錯, 執行 CLR (Common Language Runtime) Win 32 (Windows Operating System) 7

傳統高階程式語言架構 C++ 原始碼 (Source Code) 編譯 (Compile) . obj. 二進碼( binary code ) 連結(Link)

傳統高階程式語言架構 C++ 原始碼 (Source Code) 編譯 (Compile) . obj. 二進碼( binary code ) 連結(Link) . exe 二進碼( binary code ) 執行(Load, Run) Win 32 (Windows Operating System) 8

第 2支C#應用程式 /* * 第 2支C#程式 * 2/6/2009 */ using System; namespace Say. Hello

第 2支C#應用程式 /* * 第 2支C#程式 * 2/6/2009 */ using System; namespace Say. Hello { class Program { static void Main(string[] args) { string message; // 宣告變數 message = "Hello"; Console. Write. Line( message ); } } } 11

旋轉90 o 1 a 5 b 3 c 4 2 2 17

旋轉90 o 1 a 5 b 3 c 4 2 2 17

類別Program class Program { static void Main(string[] args) { //. . . } }

類別Program class Program { static void Main(string[] args) { //. . . } } 24

記憶系統的概念 *J. G. Brookshear, Computer Science – An Overview, 8 th edition, Addison-Wesley, 2005

記憶系統的概念 *J. G. Brookshear, Computer Science – An Overview, 8 th edition, Addison-Wesley, 2005 26

Main Memory 0 0 0. . . 0 1 0 0 0 ‘H’ 0

Main Memory 0 0 0. . . 0 1 0 0 0 ‘H’ 0 0 0. . . 0 1 1 0 0 1 ‘e’ 0 0 0. . . 0 1 1 0 0 ‘l’ 0 0 0. . . 0 1 1 1 1 ‘o’ 27

類別Console • 鍵盤(Keyboard) • 主控台視窗螢幕(Screen) 28

類別Console • 鍵盤(Keyboard) • 主控台視窗螢幕(Screen) 28

基本輸出與輸入 /* * 示範基本輸入, 輸出敘述 * 2/12/2009 */ using System; namespace Say. Hello. IO

基本輸出與輸入 /* * 示範基本輸入, 輸出敘述 * 2/12/2009 */ using System; namespace Say. Hello. IO { class Program { static void Main(string[] args) { Console. Write. Line("Enter your name"); string name = Console. Read. Line(); Console. Write. Line("Hello, " + name); } } } 36