Lập trình trên windows với microsoft®. net

Sử dụng các phương thức của lớp Console trong namespace System.  Console.WriteLine()  Console.Write()  Console.ReadLine()  Console.Read ()

pdf18 trang | Chia sẻ: nguyenlam99 | Lượt xem: 867 | Lượt tải: 0download
Bạn đang xem nội dung tài liệu Lập trình trên windows với microsoft®. net, để tải tài liệu về máy bạn click vào nút DOWNLOAD ở trên
Lập trình trên Windows với Microsoft® .NET Giảng viên: ThS. Trần Bá Nhiệm  Giới thiệu Microsoft.Net .  Giới thiệu ngôn ngữ C# và các khái niệm cơ bản.  Lập trình hướng đối tượng với C#.  Lập trình Winforms với C#.  Lập trình cơ sở dữ liệu với ADO.Net . Nội dung môn học  Khảo sát kiến trúc .Net .  Xây dựng các ứng dụng với .Net .  Các thành phần trong .Net Framework.  Vai trò của CLR và IL . Giới thiệu Microsoft.NET. Microsoft .NET Framework Architecture Windows LINUX Common Language Runtime Framework Class Library Common Language Specification Microsoft Visual Basic® .NET C++ C# Microsoft JScript® M ic ro s o ft V is u a l S tu d io ® .N E T XML Web Services Devices Servers User Experiences Developer Tools .NET Platform .NET Framework Common Language Runtime Class Library Windows Web Services ADO.NET Data Types Visual Basic Applications Visual C# Applications Visual C++ Applications Programming Services .NET Platform Code Source code compiles as MSIL JIT compiler produces machine language One-stop Application Development Visual Studio .NET Design Develop Debug Deploy Data Access XML Web Services Tools Windows Forms Tools Web Forms Tools Error Handling Multiple Languages Các đặc điểm của Visual Studio .NET Hỗ trợ lập trình đa ngôn ngữ. Độc lập với hệ điều hành (Platform ). Xây dựng ứng dụng nhanh chóng và dễ dàng. Hỗ trợ xây dựng ứng dụng cho nhiều thiết bị . Môi trường thiết kế trực quan . Hướng đến các ứng dụng trên Internet (Webservice, WAP) Microsoft Intermediate Language (MSIL) Common Language Specification VB C++ C# JScript J# Common Language Runtime (CLR) Just In-Time Compiler (JIT) Operating System MSIL, JIT và CLR Thực thi một chương trình .Net C# Code C# Compiler Visual Basic Code VisualBasic Compiler COBOL Code COBOL Compiler IL JIT Compiler Native Code .NET source code L a n g u a g e C o m p il e r MSIL + Metadata Machine code Code executedC L R 1st Compilation 2nd Compilation Thực thi các chương trình .NET Microsoft Intermediate Language .NET source code L a n g u a g e C o m p il e r MSIL + Metadata Machine code Code executedC L RSIL Helps Language interoperability IL is not bytecode, but is very close to it. Therefore, when the application is executed, the IL to machine code conversion is quick! MSIL converted to CPU-specific code by CLR CPU-independent set of instructions .NET source code L a n g u a g e C o m p il e r MSIL + Metadat a Machine code Code executedC L RCLR Manages memory Makes it easy to design components & applications whose objects interact across languages Cross-language integration (especially cross- language inheritance) Compile once, and run on any CPU & OS that supports the runtime! Visual C#.Net và các khái niệm cơ bản  Được phát triển bởi Microsoft do nhóm Anders Hejlsberg và Scott Wiltamuth sáng tác.  Ngôn ngữ lập trình trực quan, hướng sự kiện, hướng đối tượng.  Dựa theo ý tưởng các ngôn ngữ khác: C,C++, Java và Visual Basic.  Hỗ trợ đầy đủ bởi .Net Platform.  Compiler hiệu quả nhất trong .Net family.  Khả năng thay thế cho C++.  Hạn chế sử dụng con trỏ. Chương trình C# using System; class SampleCSharp { static void Main(string[] args) { Console.WriteLine("Hello world"); } } Các kiểu dữ liệu trong C#  Các kiểu dữ liệu đơn giản : int, float, string , char, bool..  Các kiểu dữ liệu tham chiếu : đối tượng, lớp.  Các bổ từ khi sử dụng với biến : private, public, protected  Các kiểu dữ liệu khác : Array, Struct, Enum...  Giá trị mặc định cho các kiểu dữ liệu : Nhập và xuất trong C#  Sử dụng các phương thức của lớp Console trong namespace System.  Console.WriteLine()  Console.Write()  Console.ReadLine()  Console.Read () Ví dụ : using System; class SampleCSharp { static void Main(string[] args) { //Nhập vào 1 chuỗi string s = Console.ReadLine(); //Nhập vào số nguyên int n = int.Parse(Console.ReadLine()); //In ra màn hình Console.WriteLine("s = {0} va n = {1}",s,i); } }

Các file đính kèm theo tài liệu này:

  • pdfc_co_ban_1_7819.pdf