Zmienne i Typy Danych
int liczba = 10;
string tekst = "Witaj, C#!";
bool prawda = true;
Od podstaw do zaawansowanych technik. Rozpocznij swoją przygodę z programowaniem w C#.
Zaczynamy! Dokumentacja C# Pobierz Visual Studio Pobierz .Net
int liczba = 10;
string tekst = "Witaj, C#!";
bool prawda = true;
if (liczba > 5)
{
Console.WriteLine("Liczba jest większa niż 5");
}
Console.WriteLine("Podaj swoje imię:");
string imie = Console.ReadLine(); // Wczytuje tekst od użytkownika
Console.WriteLine("Witaj, " + imie + "!");
for (int i = 1; i <= 5; i++)
{
Console.WriteLine("Numer: " + i);
}
using System;
class Program
{
static void Main()
{
Console.WriteLine("Witaj, C#!");
}
}
using System;
class Program
{
static void Main()
{
// Wczytanie danych od użytkownika
Console.WriteLine("Podaj długość prostokąta:");
double dlugosc = double.Parse(Console.ReadLine());
Console.WriteLine("Podaj szerokość prostokąta:");
double szerokosc = double.Parse(Console.ReadLine());
// Obliczanie pola prostokąta
double pole = dlugosc * szerokosc;
// Wyświetlenie wyniku
Console.WriteLine($"Pole prostokąta o bokach {dlugosc} i {szerokosc} wynosi: {pole}");
}
}
using System;
class Program
{
static void Main
{
int liczba; //Tworzenie zmiennej
int liczba = 10; //Nadawanie wartosci zmiennej
Console.WriteLine(liczba); //Wykorzystywanie zmiennej
}
}
using System;
using System.Reflection;
class Program
{
static void Main()
{
Type type = typeof(string);
MethodInfo[] methods = type.GetMethods();
foreach (var method in methods)
{
Console.WriteLine(method.Name);
}
}
}
using System;
[AttributeUsage(AttributeTargets.Class)]
class MyAttribute : Attribute
{
public string Info { get; }
public MyAttribute(string info) => Info = info;
}
[MyAttribute("Example Class")]
class ExampleClass {}
class Program
{
static void Main()
{
Type type = typeof(ExampleClass);
var attributes = type.GetCustomAttributes(typeof(MyAttribute), false);
foreach (MyAttribute attr in attributes)
{
Console.WriteLine(attr.Info);
}
}
}
using System;
using System.Dynamic;
class Program
{
static void Main()
{
dynamic expando = new ExpandoObject();
expando.Name = "John";
expando.Age = 30;
Console.WriteLine($"{expando.Name}, Age: {expando.Age}");
}
}
using System;
class Program
{
unsafe static void Main()
{
int number = 10;
int* pointer = &number;
Console.WriteLine($"Value: {number}, Address: {(long)pointer}");
}
}
using System;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
Task task1 = Task.Run(() => Console.WriteLine("Task 1"));
Task task2 = Task.Run(() => Console.WriteLine("Task 2"));
await Task.WhenAll(task1, task2);
}
}
using System;
using System.Threading;
class Program
{
static object lockObj = new object();
static void Main()
{
Thread t1 = new Thread(Print);
Thread t2 = new Thread(Print);
t1.Start();
t2.Start();
t1.Join();
t2.Join();
}
static void Print()
{
lock (lockObj)
{
Console.WriteLine("Thread: " + Thread.CurrentThread.ManagedThreadId);
Thread.Sleep(1000);
}
}
}
using System;
using System.IO;
class Program
{
static void Main()
{
using (FileStream fs = new FileStream("example.txt", FileMode.Create))
using (StreamWriter writer = new StreamWriter(fs))
{
writer.WriteLine("Hello, File!");
}
}
}
Poznaj podstawy C#, w tym zmienne, typy danych i składnię. Kurs ten da ci podstawy, które pozwolą na rozpoczęcie programowania w C#.
Kurs ten koncentruje się na funkcjach w C#. Nauczysz się, jak deklarować funkcje, przekazywać parametry i zwracać wartości.
W tym kursie zagłębimy się w zaawansowane tematy C#, takie jak LINQ, async/await i inne.
Kurs ten wprowadza do CSS (Cascading Style Sheets). Nauczysz się, jak stylizować elementy HTML, zmieniać kolory i układ strony.