Csharp 简明教程

C

C# 是一种简单、现代、通用、面向对象编程语言,由 Microsoft 在以 Anders Hejlsberg 为首的.NET 计划中开发。本 C# tutorial 将教授您基本的 C# 编程,还将带您了解 C# 编程语言相关的各种高级概念。

C# is a simple, modern, general-purpose, object-oriented programming language developed by Microsoft within its .NET initiative led by Anders Hejlsberg. This C# tutorial will teach you basic C# programming and will also take you through various advanced concepts related to C# programming language.

C# (发音为 C sharp )广泛用于开发各种应用程序,包括台式机、网络、移动、云和游戏应用程序。C# 允许开发人员构建安全健壮的.NET 应用程序。熟悉 CC++JavaJavaScript 的程序员可以轻松地理解和使用 C#,因为它采用了 C 语言和面向对象编程语言的基础知识。本教程解释了 C# 编程的基础知识,然后扩展到学习它的高级概念。

C# (pronounced "C sharp") is widely used for developing different applications, including desktop, web, mobile, cloud, and gaming applications. C# enables developers to build secure and robust.NET applications. Programmers who are familiar with C, C++, Java, and JavaScript can easily understand and work with C# because it adopts basics of C and object oriented programming languages. This tutorial explains the basics of C# programming and then extends to learn its advance concepts also.

Why C

C# 是一种面向对象和面向组件的编程语言。C# 具有直接支持的内置语言特性,使其健壮。这使其成为一种易于使用软件组件的语言。通过添加新特性来支持新任务和新的软件设计方法,C# 已经发展多年。C# 的几个特性使应用程序健壮耐用。以下是使 C# 受欢迎且使用率最高的几个关键特性:

C# is a programming language that is both object-oriented and component oriented. C# has built-in language features that directly support to make it robust. This makes it an easy language to use software components. C# has grown over the years by adding new features to support new tasks and new ways of designing software. Several features of C# make applications robust and durable. Followings are some key features that makes C# popular and most in use:

  1. Syntax: Because of its syntax’s resemblance to other C-style languages, C# is simple to learn for developers who are already proficient in languages like C, C++, and Java.

  2. Object-Oriented: C# supports object-oriented programming paradigms, including encapsulation, inheritance, and polymorphism.

  3. Compiled into an intermediate language: Code written in C# is compiled into an intermediate language (IL) that executes on the Common Language Runtime (CLR), an environment that ensures type safety, automated memory management (garbage collection), and exception handling.

  4. Platform Independence: The development and execution of C# programs can be facilitated across several platforms, such as Windows, Linux, and macOS using .NET Core or Mono.

  5. Language Integrated Query (LINQ): C# incorporates language functionalities that enable type-safe data retrieval from different sources, including databases, XML, and collections.

  6. Asynchronous Programming: C# supports asynchronous programming through the async and await keywords, allowing developers to write non-blocking code easily.

  7. Rich Standard Library: A powerful standard library (.NET Framework Class Library or .NET Core) in C# provides APIs for file I/O, networking, cryptography, and more.

总体来说,C# 是一种灵活的编程语言,在企业软件开发、游戏开发(利用 Unity 等平台)、Web 开发(利用 ASP.NET )和许多其他领域广泛使用。

Overall, C# is a flexible programming language that finds extensive usage in enterprise software development, game development (utilizing platforms such as Unity), web development (utilizing ASP.NET), and many other areas.

C

C# 是一种多用途编程语言,主要用于在 Microsoft 平台上开发软件。C# 的一些常见应用如下:

C# is a versatile programming language primarily used for developing software on the Microsoft platform. Some of the common applications of C# are as follows:

  1. Desktop Applications: Frameworks like Windows Presentation Foundation (WPF) or Windows Forms are often used with C# to make Desktop applications. These programs can be simple utilities to complex enterprise software.

  2. Web Applications: The C# programming language is used to develop web applications using ASP.NET and ASP.NET Core frameworks. Developers can use these frameworks to develop web applications, encompassing e-commerce websites, content management systems, and web APIs.

  3. Mobile Applications: Xamarin is a framework that may be used to create mobile applications for iOS, Android, and Windows Phone using C#. Xamarin facilitates the development of cross-platform mobile applications using C#, it also enables developers to share code across different platforms.

  4. Game Development: C# is used a lot in the game creation industry, particularly with the Unity game engine. Unity enables developers to build 2D and 3D games that can be played on desktop computers, mobile devices, and game consoles.

  5. Enterprise Software: It’s easy to use C# to make business software like customer relationship management (CRM) systems, enterprise resource planning (ERP) software, and business data apps.

  6. Cloud Services: With the development of cloud computing, C# is currently being used to create cloud-based apps and services. Microsoft Azure provides a broad range of services and tools for building and deploying C# apps on the cloud.

  7. Internet of Things (IoT): C# can be used to create software for IoT devices using platforms such as Windows IoT Core or building applications that operate on different IoT devices using .NET Core frameworks.

  8. Machine Learning and Data Analysis: Machine learning and data analysis tasks can be effectively performed using C#, which makes use of libraries such as ML.NET and frameworks like Microsoft Azure Machine Learning.

  9. Tools and Utilities: C# is frequently employed in the development of tools and utilities pertaining to the needs of developers, system administrators, and other professionals in technical fields. The aforementioned tools encompass code editors, debuggers, performance monitoring tools etc.

  10. Financial Applications: The C# programming language is commonly used in financial sector for the development of trading platforms, risk management systems, algorithmic trading tools, and various other financial applications.

  11. Because of its adaptability, robust community support, and interaction with the Microsoft environment, C# is a preferred language for different software development activities.

Audience

C# tutorial 已为想要了解 C# 编程语言基础和高级功能的人员准备。它在桌面应用程序、Web 应用程序、移动应用程序、游戏开发、云服务、 Internet of Things (IoT)、 Machine LearningData Analysis 、工具和实用程序以及应用程序开发所需的其它相关领域特别有用。完成本教程后,你将发现自己具有中级专业知识,你能够从中提升到 C# 编程的高级专业知识。

This C# tutorial has been prepared for those who want to learn about the basics and advance functions of C# programming language. It is specifically useful in Desktop Applications, Web Applications, Mobile Applications, Game Development, Cloud Services, Internet of Things (IoT), Machine Learning, and Data Analysis, Tools and Utilities and other related domains where application development requires. After completing this tutorial, you will find yourself at a moderate level of expertise from where you can take yourself to higher levels of expertise in C# programming.

Prerequisites

在学习该 C# tutorial 之前,你应基本了解计算机编程术语。基本了解 C、C++ 和面向对象编程以及了解任何面向对象编程语言(例如 Java)会更有帮助。

Before learning this C# tutorial, you should have a basic understanding of computer programming terminologies. A basic understanding of C, C++ and object oriented programming and leaning of any of the object oriented programming languages like Java is a plus.