Sie sind auf Seite 1von 21

Introduction to .

Net Framework
and C# Programming
Introduction to .Net framework
• It is a cluster of several technologies
- The .Net languages
- Common language runtime (CLR): Engine that
executes all .Net programs and provides
automatic services for these applications, such as
security checking, memory mgt and optimization
- The .Net framework class library: It collects
thousands of pieces of pre-built functionality that
you can “snap-in” to your applications.
- Visual Studio: Development tool by Microsoft that
contains a rich set of productivity and debugging
features.
Intermediate Language
• All .NET languages are compiled into another
lower-level language before the code is executed.
This lower-level language is the Common
Intermediate Language (CIL, or just IL). The CLR,
the engine of .NET, uses only IL code.
• All .Net languages are made compatible via
Common Language Specification (CLS) that a web
page written with C# can use a VB component in
the same way it uses a C# component and vice
versa.
Language Compilation in .Net
The Common Language Runtime
• The CLR runs only IL code, which means it has no
idea which .NET language you originally used.
• CLR takes the IL code and transforms it to native
machine language code that’s appropriate for the
current platform. This step occurs when the
application is launched, just before the code is
executed.
• In an ASP.NET application, these machine-specific
files are cached while the web application is
running so they can be reused, ensuring optimum
performance
The .Net Class Library
• The .NET class library is a giant repository of classes
that provide prefabricated functionality for almost all
sorts of programming tasks.
• You can think of the class library as a well-stocked
programmer’s toolkit. Microsoft’s philosophy is that it
will provide the tedious infrastructure so that
application developers need only to write business-
specific code. For example, the .NET Framework deals
with thorny issues such as database transactions and
concurrency, making sure that hundreds or thousands
of simultaneous users can request the same web page
at once. You just add the logic needed for your specific
application
Visual Studio (VS)
• Advantages of using Visual Studio:
- Integrated Error Checking
- Web form designer
- Integrated web server
- Developer productivity enhancements: For
example color coded syntax, automatic statement
completion and collapsible code display
- Debugging
Programming Review in C#
Programming constructs to be reviewed
• I/O statements
• Escape sequences
• Data types (Integer, String and Boolean only)
• Type casting
• Arithmetic operators and precedence
• Equality and Relational Operators with
associativity
• Control structures
- If / else structure
• While
• Assignment operators
• Increment / decrement operators
• For
• Do/while
• Switch and Case
• Use of Break and Continue
• Logical operators
Output statement using console
Output statement using console
Escape Sequences
Input Statement, Data Type and Type Casting
Arithmetic Operators
Order of Evaluation
Order of Evaluation & Associativity
Equality and Relational Operators
Associativity
If/Else selection structure

Das könnte Ihnen auch gefallen