C# 簡介Introduction to C#

歡迎使用 C# 簡介教學課程。Welcome to the introduction to C# tutorials. 這些快速入門會以可在瀏覽器中執行的互動式課程開始。These start with interactive lessons that you can run in your browser.

第一個課程會使用簡短的程式碼片段解釋 C# 概念。The first lessons explain C# concepts using small snippets of code. 您將能學習 C# 語法的基本概念,以及如何處理字串、數字和布林值等資料類型。You'll learn the basics of C# syntax and how to work with data types like strings, numbers, and booleans. 課程內容都是可互動的,因此您很快就能上手並開始撰寫和執行程式碼。It's all interactive, and you'll be writing and running code within minutes. 這些入門課程會假設您是首次接觸程式設計或 C# 語言。These first lessons assume no prior knowledge of programming or the C# language.

使用線上的瀏覽器體驗或您自己的本機開發環境,即可使用 Hello World 課程後的所有簡介教學課程。All the introductory tutorials following the Hello World lesson are available using the online browser experience or in your own local development environment. 在每個教學課程結束時,您可以決定要在線上還是在自己的電腦上繼續進行下一個課程。At the end of each tutorial, you decide if you want to continue with the next lesson online or on your own machine. 有些連結可幫助您設定環境,並在您的電腦上繼續進行下一個教學課程。There are links to help you set up your environment and continue with the next tutorial on your machine.

Hello worldHello world

Hello World 教學課程中,您將會建立最基本的 C# 程式。In the Hello world tutorial, you'll create the most basic C# program. 您將會探索 string 類型,以及處理文字的方式。You'll explore the string type and how to work with text.

C# 中的數字Numbers in C#

C# 中的數字教學課程中,您將會學習電腦儲存數字的方式,以及如何使用不同的數值型別來執行計算。In the Numbers in C# tutorial, you'll learn how computers store numbers and how to perform calculations with different numeric types. 您將會學習進位的基本概念,以及如何使用 C# 執行數學計算。You'll learn the basics of rounding, and how to perform mathematical calculations using C#. 此教學課程也可以在您的本機電腦上執行This tutorial is also available to run locally on your machine.

此教學課程假設您已完成 Hello World 課程。This tutorial assumes that you have finished the Hello world lesson.

分支和迴圈Branches and loops

分支和迴圈教學課程會指導您如何根據儲存在變數中的值選取不同程式碼執行路徑的基本概念。The Branches and loops tutorial teaches the basics of selecting different paths of code execution based on the values stored in variables. 您將會學習控制流程的基本概念,也就是程式做出決定並選擇不同動作的基礎機制。You'll learn the basics of control flow, which is the basis of how programs make decisions and choose different actions. 此教學課程也可以在您的本機電腦上執行This tutorial is also available to run locally on your machine.

此教學課程假設您已完成 Hello WorldC# 中的數字課程。This tutorial assumes that you have finished the Hello world and Numbers in C# lessons.

List 集合List collection

List 集合課程會為您說明可儲存資料序列的「List 集合」類型。The List collection lesson gives you a tour of the List collection type that stores sequences of data. 您將會學習如何新增及移除項目、搜尋項目,以及對清單進行排序。You'll learn how to add and remove items, search for items, and sort the lists. 您會探索各種不同的清單。You'll explore different kinds of lists. 此教學課程也可以在您的本機電腦上執行This tutorial is also available to run locally on your machine.

此教學課程假設您已完成上述課程。This tutorial assumes that you have finished the lessons listed above.

類別簡介Introduction to classes

這個最後的教學課程只能在您的電腦上執行,並使用您自己的本機開發環境與 .NET Core。This final tutorial is only available to run on your machine, using your own local development environment and .NET Core. 您會建置一個主控台應用程式,並了解 C# 語言的基本物件導向功能。You'll build a console application and see the basic object-oriented features that are part of the C# language.

此教學課程假設您已經完成線上簡介教學課程,並已安裝 .NET Core SDKVisual Studio CodeThis tutorial assumes you've finished the online introductory tutorials, and you've installed .NET Core SDK and Visual Studio Code.