달력

5

« 2024/5 »

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
2017. 2. 13. 02:38

Getting Started with C# 프로그래밍/C#2017. 2. 13. 02:38


  1. What's New for Visual C#
  2. Introduction to the C# Language and the .NET Framework
  3. Additional Resources for Visual C# Programmers




What's New for Visual C#


https://msdn.microsoft.com/en-us/library/hh156499.aspx


Updated: July 20, 2015

For the latest documentation on Visual Studio 2017 RC, see Visual Studio 2017 RC Documentation.

This page lists key feature names for each version of C# with descriptions of the new and enhanced features in the lastest version of the language.

C# 1, Visual Studio .NET 2002
First release

C# 1.1, Visual Studio .NET 2003
#line pragma and xml doc comments

C# 2, Visual Studio .NET 2005
Anonymous methods, generics, nullable types, iterators/yield, static classes, co/contra variance for delegates

C# 3, Visual Studio .NET 2008
Object and collection initializers, lambda expressions, extension methods, anonymous types, automatic properties, Language Integrated Query (LINQ), anonymous types, local var type inference, LINQ

C# 4, Visual Studio .NET 2010
Dynamic, named arguments, optional parameters, generic co/contra variance

C# 5, Visual Studio .NET 2012
Async / await, caller information attributes

Visual Studio .NET 2013
Bug fixes, performance improvements, and technology previews of .NET Compiler Platform (“Roslyn”)

C# 6, Visual Studio .NET 2015
Current version, see below

nameof
You can get the unqualified string name of a type or member for use in an error message without hard coding a string. This allows your code to remain correct when refactoring. This feature is also useful for hooking up model-view-controller MVC links and firing property changed events.

String Interpolation
You can use string interpolation expressions to construct strings. An interpolated string expression looks like a template string that contains expressions. C# creates a string by replacing the expressions with the ToString represenations of the expressions’ results. An interpolated string is easier to understand with respect to arguments than Composite Formatting.

Null-conditional Member Access and Indexing
You can test for null in a very light syntactic way before performing a member access (?.) or index (?[]) operation. These operators help you write less code to handle null checks, especially for descending into data structures. If the left operand or object reference is null, the operations returns null.

Index Initializers
You can now initialize specific elements of a collection that supports indexing, such as initializing a dictionary.

Collection Initializer and Add Extension Methods
You can use initializers for collections now when the collection has an Add Extension method. Previously the Add method had to be an instance method.

Overload Resolution
The compiler has improved overload resolution that results in more code just working the way you would expect it to behave. One place where you might stop noticing a problem is when choosing between overloads taking nullable value types, or when passing method groups (instead of lambdas) to overloads that take delegates.

Exception Filters
You can use exception filers in catch clauses to determine whether a catch clause should handle the exception. Without this feature, you have to rethrow the exception, which clips the call stack reported in the rethrown exception.

Await in Catch and Finally Blocks
You can use await in catch and finally clauses.

Auto-property Initializers
You can initialize auto-properties now similarly to how you initialize fields.

Getter-only Auto-properites
You can define read-only auto-properties now without having to define a property with complete property syntax. You can initialize the property where you declare it or in the type’s constructor.

Function Members with Expression Bodies
You can declare members with expression-bodies of code in the same lightweight syntax you use with lambda expressions. See MethodsPropertiesIndexers, and Overloadable Operators.

Using Static
You can import accessible static members of static types so that you can refer to the members without qualifying the access with the type’s name.






Introduction to the C# Language and the .NET Framework


https://msdn.microsoft.com/en-us/library/z1zx9t92.aspx


Updated: July 20, 2015

For the latest documentation on Visual Studio 2017 RC, see Visual Studio 2017 RC Documentation.

C# is an elegant and type-safe object-oriented language that enables developers to build a variety of secure and robust applications that run on the .NET Framework. You can use C# to create Windows client applications, XML Web services, distributed components, client-server applications, database applications, and much, much more. Visual C# provides an advanced code editor, convenient user interface designers, integrated debugger, and many other tools to make it easier to develop applications based on the C# language and the .NET Framework.

System_CAPS_ICON_note.jpg Note

The Visual C# documentation assumes that you have an understanding of basic programming concepts. If you are a complete beginner, you might want to explore Visual C# Express, which is available on the Web. You can also take advantage of books and Web resources about C# to learn practical programming skills.

C# syntax is highly expressive, yet it is also simple and easy to learn. The curly-brace syntax of C# will be instantly recognizable to anyone familiar with C, C++ or Java. Developers who know any of these languages are typically able to begin to work productively in C# within a very short time. C# syntax simplifies many of the complexities of C++ and provides powerful features such as nullable value types, enumerations, delegates, lambda expressions and direct memory access, which are not found in Java. C# supports generic methods and types, which provide increased type safety and performance, and iterators, which enable implementers of collection classes to define custom iteration behaviors that are simple to use by client code. Language-Integrated Query (LINQ) expressions make the strongly-typed query a first-class language construct.

As an object-oriented language, C# supports the concepts of encapsulation, inheritance, and polymorphism. All variables and methods, including the Main method, the application's entry point, are encapsulated within class definitions. A class may inherit directly from one parent class, but it may implement any number of interfaces. Methods that override virtual methods in a parent class require the override keyword as a way to avoid accidental redefinition. In C#, a struct is like a lightweight class; it is a stack-allocated type that can implement interfaces but does not support inheritance.

In addition to these basic object-oriented principles, C# makes it easy to develop software components through several innovative language constructs, including the following:

  • Encapsulated method signatures called delegates, which enable type-safe event notifications.

  • Properties, which serve as accessors for private member variables.

  • Attributes, which provide declarative metadata about types at run time.

  • Inline XML documentation comments.

  • Language-Integrated Query (LINQ) which provides built-in query capabilities across a variety of data sources.

If you have to interact with other Windows software such as COM objects or native Win32 DLLs, you can do this in C# through a process called "Interop." Interop enables C# programs to do almost anything that a native C++ application can do. C# even supports pointers and the concept of "unsafe" code for those cases in which direct memory access is absolutely critical.

The C# build process is simple compared to C and C++ and more flexible than in Java. There are no separate header files, and no requirement that methods and types be declared in a particular order. A C# source file may define any number of classes, structs, interfaces, and events.

The following are additional C# resources:

C# programs run on the .NET Framework, an integral component of Windows that includes a virtual execution system called the common language runtime (CLR) and a unified set of class libraries. The CLR is the commercial implementation by Microsoft of the common language infrastructure (CLI), an international standard that is the basis for creating execution and development environments in which languages and libraries work together seamlessly.

Source code written in C# is compiled into an intermediate language (IL) that conforms to the CLI specification. The IL code and resources, such as bitmaps and strings, are stored on disk in an executable file called an assembly, typically with an extension of .exe or .dll. An assembly contains a manifest that provides information about the assembly's types, version, culture, and security requirements.

When the C# program is executed, the assembly is loaded into the CLR, which might take various actions based on the information in the manifest. Then, if the security requirements are met, the CLR performs just in time (JIT) compilation to convert the IL code to native machine instructions. The CLR also provides other services related to automatic garbage collection, exception handling, and resource management. Code that is executed by the CLR is sometimes referred to as "managed code," in contrast to "unmanaged code" which is compiled into native machine language that targets a specific system. The following diagram illustrates the compile-time and run-time relationships of C# source code files, the .NET Framework class libraries, assemblies, and the CLR.

From C# source code to machine execution

Language interoperability is a key feature of the .NET Framework. Because the IL code produced by the C# compiler conforms to the Common Type Specification (CTS), IL code generated from C# can interact with code that was generated from the .NET versions of Visual Basic, Visual C++, or any of more than 20 other CTS-compliant languages. A single assembly may contain multiple modules written in different .NET languages, and the types can reference each other just as if they were written in the same language.

In addition to the run time services, the .NET Framework also includes an extensive library of over 4000 classes organized into namespaces that provide a wide variety of useful functionality for everything from file input and output to string manipulation to XML parsing, to Windows Forms controls. The typical C# application uses the .NET Framework class library extensively to handle common "plumbing" chores.

For more information about the .NET Framework, see Overview of the Microsoft .NET Framework.

C# Language Fundamentals in Learning C# 3.0: Master the fundamentals of C# 3.0

C# and .NET Programming in Learning C# 3.0: Master the fundamentals of C# 3.0

Introducing C# in Beginning Visual C# 2010

Visual Studio 2008 and C# Express 2008 in Learning C# 3.0: Master the fundamentals of C# 3.0






Additional Resources for Visual C# Programmers


Updated: July 20, 2015

For the latest documentation on Visual Studio 2017 RC, see Visual Studio 2017 RC Documentation.

The following sites can help you find answers to common problems.

On the Web

Microsoft Visual C# Developer Center
Provides code samples, upgrade information, downloads, and technical content.

Microsoft Help and Support
Provides access to Knowledge Base (KB) articles, downloads and updates, support Webcasts, and other services.

CodePlex
Hosts open source software projects. You can use CodePlex to create new projects to share with the world or join others who have already started their own projects.

Forums

Visual C# Language
Provides a forum for questions about and general discussions of the C# language and compiler.

Visual C# General
Provides a forum for general discussion and questions regarding Visual C#.

Visual C# IDE
Provides a forum for discussions about the C# IDE.

MSDN Forums
Provides information about forums in which you can post questions and answers, and also view and search existing user-generated Help content. You can also access the MSDN forums by clicking MSDN Forums on the Help menu.

Chats and Discussion Groups

MSDN Discussion Groups
Provides a newsgroup experience, enabling you to connect as a community with experts from around the world.

MSDN Chats
Provides discussions about Microsoft products and technologies. Each chat is hosted by one or more Microsoft experts. Transcripts are available for completed chats.

Videos and Webcasts

Channel9
Provides a community through videos, Wikis, and forums.

Support

File Bugs or Make Suggestions
Enables you to file bugs or provide suggestions to Microsoft about Visual Studio. You can also report a bug by clicking Report a Bug on the Help menu.

MSDN's Web site provides information about current third-party sites and newsgroups of interest. For the most current list of resources available, see the MSDN C# Community Web site.





















'프로그래밍 > C#' 카테고리의 다른 글

Sockets  (0) 2017.03.02
Using the Visual Studio Development Environment for C#  (0) 2017.02.14
클래스 종류 헤드라인  (0) 2017.01.04
C# Keywords - Types  (0) 2016.12.29
helpful classes  (0) 2016.11.24
:
Posted by 지훈2