SlideServe
Menu
Préférences
© SlideServe · v2026

QuickStart C#

teigra avatar
14 diapositives · 315 Views · Sep 06, 2012

QuickStart C#. Learning to Program in C# Amy Roberge & John Linehan November 7, 2005. The C# Programming Language. Developed in 2000 Created by Microsoft as part of their .NET platform to unite programming languages for web based usage

QuickStart C# - slide 1
01 / 14QuickStart C#
1 / 17

Télécharger la présentation

QuickStart C#
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. QuickStart C# Learning to Program in C# Amy Roberge & John Linehan November 7, 2005

  2. The C# Programming Language • Developed in 2000 • Created by Microsoft as part of their .NET platform to unite programming languages for web based usage • Microsoft chose the chief programmer of Delphi, Anders Hejlsberg, to lead the development of C# • Based on C++ and Java. More of an extension of existing languages than a new one. • The name C# is supposed to be a progression of C++ and the # contains four + symbols • .NET is proprietary. Mono is an open source project led by Novell to make a compatible set of .NET tools Applied Computing Technology Laboratory

  3. Similarities Require a virtual machine Similar syntax Automatic garbage collection Object oriented Large class library C# over Java Allows “structs” Switch statements can be applied to strings (vs. characters or numbers) Support for output parameters, allowing multiple values to be returned C# vs. Java Applied Computing Technology Laboratory

  4. C# Advantages • Only allows single inheritance, but can implement any number of interfaces • Provides a balance of C++, rapid development, Visual Basic, Delphi, and Java • Automatic garbage collection Applied Computing Technology Laboratory

  5. C# Disadvantages • Requires the .NET Runtime Environment to run • More overhead • Doesn’t have true multiple inheritance • “Unsafe code” is required to manage memory directly and can be very complex and difficult to debug Applied Computing Technology Laboratory

  6. C# Specification • Available from MSDN (Microsoft Developer Network): http://msdn.microsoft.com/vcsharp/programming/language/ Current as of 3/2005, C# 2.0 Explains: • Grammar • Structure • Generics • Types, values, variables, iterators • Type conversions and promotions • Classes, methods • Arrays, exceptions, execution, blocks, statements, expressions, declarations, interfaces, arguments Applied Computing Technology Laboratory

  7. C# Grammar • Available on MSDN web sitehttp://msdn.microsoft.com/library/default.asp?url=/library/en-us/csspec/html/vclrfcsharpspec_c.asp • Example: Type:Identifier [TypeArguments]{ . Identifier [TypeArguments]} {[]}BasicType TypeArguments:< TypeArgument {, TypeArgument} > TypeArgument:Type ? [( extends | super ) Type] Identifier:IDENTIFIER BasicType:byte | short | char | int | long | float | double | boolean Applied Computing Technology Laboratory

  8. Reserved Words Applied Computing Technology Laboratory

  9. Step 1: Getting Started • Download & install .NET Framework SDK 1.1:http://www.microsoft.com/downloads/details.aspx?familyid=9b3a2ca6-3647-4070-9f41-a333c6b9181d&displaylang=en • Double-click on file to run installer • Follow all the defaults Applied Computing Technology Laboratory

  10. Step 2: SharpDevelop • Opensource IDE • Download & install SharpDevelop from:http://www.icsha`rpcode.net/OpenSource/SD/Download/ • Run the installation and launch SharpDevelop Applied Computing Technology Laboratory

  11. Step 3: Write a simple program • File->New->Combine • Select “C#” category and new Console Application template and click Create • Name project “Hello World” • SharpDevelop recognizes the Hello World name and automatically produces the code Applied Computing Technology Laboratory

  12. Hello World using System; namespace Hello_World { class MainClass { public static void Main(string[] args) { Console.WriteLine("Hello World!"); } } } Applied Computing Technology Laboratory

  13. Step 4: Run the program • Click Build • Select Build Combine • View the console at the bottom for progress • After the file is compiled, select Debug and then click Run. • Watch the command prompt window open and display the output Applied Computing Technology Laboratory

  14. Learning more about C# • Visit the QuickStart Languages web sitehttp://actlab.csc.villanova.edu/quickstart • Visit C# Station http://www.csharp-station.com/ • Visit the Microsoft Developer Center http://msdn.microsoft.com/vcsharp/ • Find Helpful C# tools http://msdn.microsoft.com/vcsharp/programming/tools/ • Wikipedia http://en.wikipedia.org/wiki/C_Sharp Applied Computing Technology Laboratory