Ranglar va fon


Download 1.19 Mb.
bet1/6
Sana25.02.2023
Hajmi1.19 Mb.
#1227730
  1   2   3   4   5   6
Bog'liq
2. Dasturlash tili asoslari

Dasturlash tili asoslari

C# dasturlash tili

C# - ko'p paradigmali umumiy maqsadli dasturlash tili.

Anders Hejlsberg (Microsoft) boshchiligidagi jamoa tomonidan 2000 yilda ishlab chiqilgan.

C# 10.0, .NET 6.0, Visual Studio 2022.

  • https://visualstudio.microsoft.com/
  • https://code.visualstudio.com/
  • https://www.jetbrains.com/rider/
  • https://en.wikipedia.org/wiki/C_Sharp_(programming_language)
  • https://en.wikipedia.org/wiki/Programming_paradigm
  • https://en.wikipedia.org/wiki/Comparison_of_multi-paradigm_programming_languages

Visual Studio

VS Code

Jetbrains Rider

Visual Studio Community Edition

Visual Studioni o'rnatish

Visual Studioni o'rnatish

Yangi console loyiha (project) yaratish

Yangi console loyiha (project) yaratish

Kod yozish

Birinchi dastur

.NET 6 dan boshlab:

.NET 5 va undan oldingi versiyalarda:

using System;

namespace MyApp // Note: actual namespace depends on the project name.

{

internal class Program

{

static void Main(string[] args)

{

Console.WriteLine("Hello World!");

}

}

}


// See https://aka.ms/new-console-template for more information
Console.WriteLine("Hello, World!");

Yangi loyiha yaratish (VS Code)

  • Visual Studio Code ishga tushuriladi;
  • Bosh menyudan: File > Open Folder tanlanadi;
  • Open Folder dialog oynasida HelloWorld nomli papka yaratiladi va uni tanlab Select Folder tugmasi bosiladi (papka nomi kelishuv bo'yicha loyiha nomi sifatida ishlatiladi);
  • Visual Studio Code da Terminal ochiladi (View > Terminal, yoki Ctrl + ~);
  • Terminalda quyidagi buyruq bajariladi: dotnet new console yoki dotnet new console --framework net5.0 yoki dotnet new console --framework net6.0
  • Dastur kodlari yozilgandan so'ng uni ishga tushurish uchun: dotnet run yoki dotnet build va dotnet run

Download 1.19 Mb.

Do'stlaringiz bilan baham:
  1   2   3   4   5   6




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling