操作指南 (C#)How to (C#)

在 C# 指南中的操作指南部分快速了解常见问题的答案。In the How to section of the C# Guide you can find quick answers to common questions. 在某些情况下,可能会在多个部分列出相关文章。In some cases, articles may be listed in multiple sections. 我们希望用户可从多个搜索路径找到操作指南。We wanted to make them easy to find for multiple search paths.

C# 一般概念General C# concepts

此处介绍了 C# 开发者在实践中常会用到的几个提示和技巧。There are several tips and tricks that are common C# developer practices.

类和结构成员Class and struct members

创建类和结构来实现程序。You create classes and structs to implement your program. 编写类或结构时常会使用这些方法。These techniques are commonly used when writing classes or structs.

使用集合Working with collections

这些文章有助于了解如何使用数据集合。These articles help you work with collections of data.

处理字符串Working with strings

字符串是用于显示或操作文本的基本数据类型。Strings are the fundamental data type used to display or manipulate text. 这些文章介绍了字符串的常见处理方法。These articles demonstrate common practices with strings.

在类型间转换Convert between types

你可能需要将对象转换为其他类型。You may need to convert an object to a different type.

相等比较和排序比较Equality and ordering comparisons

可创建类型来定义自己的相等规则,或者定义该类型对象间的自然顺序。You may create types that define their own rules for equality or define a natural ordering among objects of that type.

异常处理Exception handling

.NET 程序通过引发异常报告方法未能成功完成其任务。.NET programs report that methods did not successfully complete their work by throwing exceptions. 通过这些文章可了解如何处理异常。In these articles you'll learn to work with exceptions.

委托和事件Delegates and events

委托和事件为涉及松散耦合代码块的策略提供了功能。Delegates and events provide a capability for strategies that involve loosely coupled blocks of code.

事件提供发布或订阅通知的机制。Events provide a mechanism to publish or subscribe to notifications.

LINQ 做法LINQ practices

通过 LINQ 可编写代码来查询任何支持 LINQ 查询表达式模式的数据源。LINQ enables you to write code to query any data source that supports the LINQ query expression pattern. 这些文章有助于你理解该模式并使用不同的数据源。These articles help you understand the pattern and work with different data sources.

多线程和异步处理Multiple threads and async processing

新式程序常使用异步操作。Modern programs often use asynchronous operations. 这些文章可帮助你了解如何使用这些方法。These articles will help you learn to use these techniques.

程序的命令行参数Command line args to your program

通常情况下,C# 程序具有命令行参数。Typically, C# programs have command line arguments. 通过这些文章可了解如何访问和处理这些命令行参数。These articles teach you to access and process those command line arguments.