Bài giảng C# 2010 - Chapter 1: Introduction to the Visual Studio 2010

Write source code c# and saved file with .cs extension

C# compiler=> Compile source code to an intermediate language (MSIL)

MSIL is contained in an assembly(.exe or .dll extension)

Can use source code or reference .NET framework libraries

 

pptx41 trang | Chuyên mục: Visual C# | Chia sẻ: dkS00TYs | Lượt xem: 2146 | Lượt tải: 1download
Tóm tắt nội dung Bài giảng C# 2010 - Chapter 1: Introduction to the Visual Studio 2010, để xem tài liệu hoàn chỉnh bạn click vào nút "TẢI VỀ" ở trên
Click to edit Master title style Click to edit Master text styles Second level Third level Fourth level Fifth level 13/05/2013 ‹#› Introduction to the Visual Studio 2010 Chapter 1: What you Learn in this chapter? What’s the .NET Framework & What it contains What C# is &How a C# Program runs Visual Studio 2010 & C# DEMO C# Console .Net Framework [4.0] Microsoft’s Modern software development platform Support several programming languages: C# ,VB, C++,F#... Common Language Runtime (CLR) Include .NET Framework Class Library(FCL) Programming language use to create application will run in the .NET CLR Why C# ? Evolution of the C & C++ languages Incorporate the best features from other languages & Clearing up their problems Syntax is simple Directly accessing & manipulating system memory Application you can write in C# Windows Application Web Application Web Services How a C# program runs? C# Source (.cs) C# compiler Assembly (.exe or .dll) CLR loader CLR JIT compiler Operating system CPU & other hardware .NET libraries 1 Write source code c# and saved file with .cs extension 2 C# compiler=> Compile source code to an intermediate language (MSIL) 3 MSIL is contained in an assembly(.exe or .dll extension) 4 Can use source code or reference .NET framework libraries 5 CLR runs on top of host operating system 6 CLR loads assembly & uses JIT compiler to translate MSIL to native machine code 7 Load .NET libraries if need 8 MSIL code can execute on any CPUs if CPU is supported by CLR Visual Studio 2010 Powerful, professional Integrated Development Environment (IDE) Integrated compiler, debugger, Other useful tool… We can work: Console application Window application Web application .NET Libraries Visual Studio 2010 Solution ??? Project & Project Properties Build ??? Debugging??? Solutions and Projects group the items needed to create a program or application: A Solution can contain one or more Project A Project represents a particular part of a solution A Project contains source code file, settings & resource for application A Project can contain Class Reference libraries Etc… How to create Solution & Project? 1 Solution 1. File/New/Project (or Ctrl+ Shift +N) 2. Choose “Visual Studio Solutions” in left panel 3. Enter Name & location solution => click OK You can see “Solution1” name in the right panel How To add New Project: 2 Right click on Solution1 Choose Add item Choose New Project add New Project Dialog You can choose any Application Type name & click OK Many different projects in the Solution Problem: You don’t know which Project that you want to run Right click on Project Choose Set as StartUp Project Problem: We have many Window Computing Platform… To any PC can run your Application, you must config as below Right click on Project & choose Properties Or Go to menu Project => Choose Project properties Project Properties dialog Go to Build tab Platform target please choose “Any CPU” Save project How to add New Item in the Project 1.Right click on Project 2.Choose Add item 3.Choose New Item Choose any item Enter name and click “Add” button AssemblyInfo file Reference .NET libraries Solution Folder content Project Folder content How to build Solution & Project Build Solution Build Project Batch Build Batch Build You should use Batch Build You can check or uncheck project to build Build How to Debugging? Choose line you want to start debugging Go to Debug menu Choose Toggle Breakpoint or press F9 Breakpoint here 4. Go to Debug 5. Choose Start Debugging or press F5 Also you can clear all Breakpoints You can see The Yellow Line And the name + value of variables Step Into Step Over Step Out Use QuickWatch to see detail information of variable at runtime QuickWatch Dialog here Variable’s infor You can change value of the variable and click Reevaluate button END 

File đính kèm:

  • pptxBài giảng C# 2010 - Chapter 1 Introduction to the Visual Studio 2010.pptx
Tài liệu liên quan