C# Intro

Saturday, October 26, 2013

.NET Software Framework


Download and install .NET Framework


Common Language Runtime manages the application when it runs

  • Memory Management
  • Security
  • Operating System and Hardware Independence
  • CLR is like a virtual machine
  • Language Independence


Framework Class Library a library of functionality to build applications

  • 1000's of classes to build great applications, web, windows, services, distributed
  • The largest library in the history of humanity
  • WPF, Windows Forms, Web Forms, MVC, Web Api, WCF apps and more


C#

  • Standardized language to create .NET components
  • Standardized by ECMA
  • Create applications, services and reusable libraries
  • Syntax is similar to Java and C++


C# code snippet, if it's Saturday write saturday out to console, else write nothing


use command prompt create file helloworld.cs


Code to print out hello c# to the console window


Goto directory of the c# compiler csc.exe and compile the file


Look in the directory an executable .exe has been generated


Execute it and it writes out hello c#


Hello C# inside of visual studio


Execute the program from the command line compiler


Write the first element in array to the screen


Execute the program and specify a parameter


Types: Value Types directly contain data, Reference Types store references to objects


Output, struct remains same, reference type affects the object that both reference


Predefined Types


Declare and initialise variables for use


Operators

Default Success Warning Important Info Inverse
B S W I ? O