0% found this document useful (0 votes)
24 views

Programmation Csharp

The document provides an overview of prerequisites and basics for Windows programming in Csharp. It outlines recommended hardware specifications including a Core i5 processor with 8GB RAM and the latest Windows 10 OS. It also lists required software including the .NET Framework 4.8, Visual Studio IDE, and an oriented programming language like C#. The document then covers basic Csharp concepts such as syntax, data types, variables, assignments, operators, and control flow instructions.

Uploaded by

Ines
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

Programmation Csharp

The document provides an overview of prerequisites and basics for Windows programming in Csharp. It outlines recommended hardware specifications including a Core i5 processor with 8GB RAM and the latest Windows 10 OS. It also lists required software including the .NET Framework 4.8, Visual Studio IDE, and an oriented programming language like C#. The document then covers basic Csharp concepts such as syntax, data types, variables, assignments, operators, and control flow instructions.

Uploaded by

Ines
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 31

Windows programming

Willy-joël TCHANA
Software engineer : Software Architect
CEO of Over Soft Solution

1 @willytchana @osschannel +237 677 392 752


2 Agenda

 Prerequisites
 Basics of Csharp language
3 Prerequisites

 Computer Core i5, 8 Gb RAM recommended


 Windows OS 10 last update
 The dotnet Framework 4.8
 IDE Visual studio latest
 Platform programming language
Prerequisites
4
Computer Core i5, 8 Gb RAM recommended
Prerequisites
5 Computer Core i5, 8 Gb RAM recommended
Prerequisites
6 Windows OS 10 last update

https://go.microsoft.com/fwlink/?LinkID=799445
Prerequisites
7 The dotnet Framework 4.8

 A Framework
 .Net Framework 4x
 .Net Core 3x
 .Net 5
 A runtime
8
Prerequisites
IDE Visual Studio latest

 VS Installer
 h
tps://visualstudio.microsoft.com/fr/thank-you-downloading-visual-studio/?sku
=Community&rel=16

 VS 2019 Community
 Outlook account
Prerequisites
9
IDE Visual Studio latest: Visual studio installer
Prerequisites
10
IDE Visual Studio latest: VS installer
Prerequisites
11
IDE Visual Studio latest: VS 2019 community
Prerequisites
12
IDE Visual Studio latest: VS 2019 with account
Prerequisites
13 Platform programming language

 VB.NET
 C++
 F#
 C#
 All this language are oriented programming language
Prerequisites
14 Platform programming language
Basics of Csharp language
15

 Syntax
 Base data types
 Variable declaration
 Assignment
 Cast
 Operators
 Conditional instructions
 Iterative instructions
 Arrays
 Functions
 Data structures
 Conventions
Basics of Csharp language
16 Syntax

using System;
namespace MyCSharpProject
{
class Program
{
/*Like C program,
C# start with execution with main function
*/
static void Main(string[] args)
{
string message = "Hello World!!";
//Print to screen
Console.WriteLine(message);
}
}
}
Basics of Csharp language
17 Base data types: Numbers
Basics of Csharp language
18 Base data types: Strings

 char: 'a', '1', '+'


 string: "this is a string", "s"
 Special Characters
 \
 \n, \t, \r, etc.
 Escape Sequence : @
 Ex: @"xyzdefr\abc";
 String concatenation
 Ex: "Mr." + firstName + " " + lastName + ", Code: " + code;
 String Interpolation : $
 $"Mr. {firstName} {lastName}, Code: {code}";
Basics of Csharp language
19 Base data types: Boolean

 bool: true, false


Basics of Csharp language
20 Base data types: DateTime

 DateTime is not a C# data type, it’s a .Net


Framework type
 You need to import namespace System
 ISO Format: yyyy-MM-dd
Basics of Csharp language
21 Variable declaration

 int num;
 float rate;
 decimal amount;
 char code;
 bool isValid;
 string name;
 DateTime date;
Basics of Csharp language
22 Assignment

 num = 100;
 rate = 10.2f;
 amount = 100.50M;
 char code = 'C';
 bool isValid = true;
 string name = "Steve";
 DateTime date = new DateTime(2020, 12, 31);
Basics of Csharp language
23 Assignment: var keyword

 var num = 100;


 var date = new DateTime(2020, 12, 31);
Basics of Csharp language
24 Cast: number to number

 double price = (double)100;


 float price = (float)num;
 var num = (int) price;
Basics of Csharp language
25 Cast: number to string

 string text = price.ToString();


 var amount = price.ToString("N2")
Basics of Csharp language
26 Cast: number to string

 string text = price.ToString();


 var amount = price.ToString("N2");
 string today = date.ToString("dd/MM/yyyy");
Basics of Csharp language
27 Cast: string to number

 int num = int.Parse("100");


 int num = int.Parse("100 0"); //Error
 int num;
 bool canParse = int.TryParse("100 0", out num);
 bool.Parse(string);
 double.Parse(string);
 DateTime.Parse(string);
 Etc.
Basics of Csharp language
28 operators

 Same to C language
Basics of Csharp language
Conditional instructions
29

 Same to C language
Basics of Csharp language
Iterative instructions
30

 Same to C language
 foreach(int a in myArray)
{
Console.WriteLine(a.ToString());
}
FIN
31

Questions

You might also like