diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..fb90bd4 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,73 @@ +name: Continuous Integration + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '10.0.x' + + - name: List all solutions + run: | + echo "Found the following solution files:" + find . \( -name "*.sln" -o -name "*.slnx" \) -type f | sort + echo "Total solutions: $(find . \( -name '*.sln' -o -name '*.slnx' \) -type f | wc -l)" + + - name: Build all solutions + shell: bash + run: | + set -e + echo "Building all solutions in the repository..." + + # Create arrays to track results + declare -a failed_solutions=() + declare -a successful_solutions=() + + # Build each solution + while IFS= read -r solution; do + echo "" + echo "========================================" + echo "Building solution: $solution" + echo "========================================" + + if dotnet build "$solution" --configuration Release --verbosity minimal; then + echo "✅ Build successful for $solution" + successful_solutions+=("$solution") + else + echo "❌ Build failed for $solution" + failed_solutions+=("$solution") + fi + done < <(find . \( -name "*.sln" -o -name "*.slnx" \) -type f | sort) + + # Print summary + echo "" + echo "========================================" + echo "BUILD SUMMARY" + echo "========================================" + echo "Total solutions: $((${#successful_solutions[@]} + ${#failed_solutions[@]}))" + echo "Successful builds: ${#successful_solutions[@]}" + echo "Failed builds: ${#failed_solutions[@]}" + + if [ ${#failed_solutions[@]} -gt 0 ]; then + echo "" + echo "Failed solutions:" + for solution in "${failed_solutions[@]}"; do + echo " - $solution" + done + exit 1 + else + echo "" + echo "🎉 All solutions built successfully!" + fi \ No newline at end of file diff --git a/BankingOop/BankingOop/BankingOop.csproj b/BankingOop/BankingOop/BankingOop.csproj index 74abf5c..dfb40ca 100644 --- a/BankingOop/BankingOop/BankingOop.csproj +++ b/BankingOop/BankingOop/BankingOop.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net10.0 enable enable diff --git a/BankingOop2/BankingOop2/BankingOop2.csproj b/BankingOop2/BankingOop2/BankingOop2.csproj index 6e03507..abb927a 100644 --- a/BankingOop2/BankingOop2/BankingOop2.csproj +++ b/BankingOop2/BankingOop2/BankingOop2.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net10.0 enable Banking diff --git a/BinarySearchTree/BinarySearchTree/BinarySearchTree.csproj b/BinarySearchTree/BinarySearchTree/BinarySearchTree.csproj index fb76edd..3804262 100644 --- a/BinarySearchTree/BinarySearchTree/BinarySearchTree.csproj +++ b/BinarySearchTree/BinarySearchTree/BinarySearchTree.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net10.0 enable diff --git a/BracesValidator/BracesValidator/BracesValidator.csproj b/BracesValidator/BracesValidator/BracesValidator.csproj index 74abf5c..dfb40ca 100644 --- a/BracesValidator/BracesValidator/BracesValidator.csproj +++ b/BracesValidator/BracesValidator/BracesValidator.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net10.0 enable enable diff --git a/CloveceNezlobSe/CloveceNezlobSe/CloveceNezlobSe.csproj b/CloveceNezlobSe/CloveceNezlobSe/CloveceNezlobSe.csproj index f67f521..3804262 100644 --- a/CloveceNezlobSe/CloveceNezlobSe/CloveceNezlobSe.csproj +++ b/CloveceNezlobSe/CloveceNezlobSe/CloveceNezlobSe.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net10.0 enable diff --git a/Collatz/Collatz/Collatz.csproj b/Collatz/Collatz/Collatz.csproj index 74abf5c..dfb40ca 100644 --- a/Collatz/Collatz/Collatz.csproj +++ b/Collatz/Collatz/Collatz.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net10.0 enable enable diff --git a/DatabaseConnector/DatabaseConnector/DatabaseConnector.csproj b/DatabaseConnector/DatabaseConnector/DatabaseConnector.csproj index 37a28ad..a6aef07 100644 --- a/DatabaseConnector/DatabaseConnector/DatabaseConnector.csproj +++ b/DatabaseConnector/DatabaseConnector/DatabaseConnector.csproj @@ -2,7 +2,8 @@ Exe - netcoreapp3.1 + net10.0 + enable diff --git a/DatabaseConnector/DatabaseConnector/Program.cs b/DatabaseConnector/DatabaseConnector/Program.cs index daa18a7..fd3a56b 100644 --- a/DatabaseConnector/DatabaseConnector/Program.cs +++ b/DatabaseConnector/DatabaseConnector/Program.cs @@ -1,34 +1,24 @@ -using System; using System.Data.SqlClient; -namespace DatabaseConnector -{ - class Program - { - static void Main(string[] args) - { - using var conn = new SqlConnection("***"); - conn.Open(); - using var cmd = new SqlCommand("SELECT COUNT(*) FROM Zapisnik", conn); - Console.WriteLine(cmd.ExecuteScalar()); +using var conn = new SqlConnection("***"); +conn.Open(); +using var cmd = new SqlCommand("SELECT COUNT(*) FROM Zapisnik", conn); +Console.WriteLine(cmd.ExecuteScalar()); - cmd.CommandText = "INSERT INTO Zapisnik(Jmeno, Obsah) VALUES('První pokus', 'Hokus pokus')"; - cmd.ExecuteNonQuery(); +cmd.CommandText = "INSERT INTO Zapisnik(Jmeno, Obsah) VALUES('První pokus', 'Hokus pokus')"; +cmd.ExecuteNonQuery(); - cmd.CommandText = "SELECT COUNT(*) FROM Zapisnik"; - Console.WriteLine(cmd.ExecuteScalar()); +cmd.CommandText = "SELECT COUNT(*) FROM Zapisnik"; +Console.WriteLine(cmd.ExecuteScalar()); - using var cmd2 = new SqlCommand("SELECT TOP 10 * FROM Customer", conn); - using (var reader = cmd2.ExecuteReader()) - { - while (reader.Read()) - { - var firstName = reader["FirstName"]; - var lastName = reader["LastName"]; +using var cmd2 = new SqlCommand("SELECT TOP 10 * FROM Customer", conn); +using (var reader = cmd2.ExecuteReader()) +{ + while (reader.Read()) + { + var firstName = reader["FirstName"]; + var lastName = reader["LastName"]; - Console.WriteLine($"Načten zákazník: {firstName} {lastName}"); - } - } - } + Console.WriteLine($"Načten zákazník: {firstName} {lastName}"); } } diff --git a/DigitalRoot/DigitalRoot/DigitalRoot.csproj b/DigitalRoot/DigitalRoot/DigitalRoot.csproj index 74abf5c..dfb40ca 100644 --- a/DigitalRoot/DigitalRoot/DigitalRoot.csproj +++ b/DigitalRoot/DigitalRoot/DigitalRoot.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net10.0 enable enable diff --git a/DijkstraShortestPath/DijkstraShortestPath.csproj b/DijkstraShortestPath/DijkstraShortestPath.csproj index c06b92e..c691af9 100644 --- a/DijkstraShortestPath/DijkstraShortestPath.csproj +++ b/DijkstraShortestPath/DijkstraShortestPath.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net10.0 enable diff --git a/DirectionsReduction/DirectionsReduction/DirectionsReduction.csproj b/DirectionsReduction/DirectionsReduction/DirectionsReduction.csproj index 8322db5..b73beda 100644 --- a/DirectionsReduction/DirectionsReduction/DirectionsReduction.csproj +++ b/DirectionsReduction/DirectionsReduction/DirectionsReduction.csproj @@ -1,7 +1,8 @@ - net6.0 + net10.0 + enable false diff --git a/DuplicateEncoder/DuplicateEncoder/DuplicateEncoder.csproj b/DuplicateEncoder/DuplicateEncoder/DuplicateEncoder.csproj index fb76edd..3804262 100644 --- a/DuplicateEncoder/DuplicateEncoder/DuplicateEncoder.csproj +++ b/DuplicateEncoder/DuplicateEncoder/DuplicateEncoder.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net10.0 enable diff --git a/ExceptionHandlingCalculator/ExceptionHandlingCalculator/ExceptionHandlingCalculator.csproj b/ExceptionHandlingCalculator/ExceptionHandlingCalculator/ExceptionHandlingCalculator.csproj index eea0e5e..1016a12 100644 --- a/ExceptionHandlingCalculator/ExceptionHandlingCalculator/ExceptionHandlingCalculator.csproj +++ b/ExceptionHandlingCalculator/ExceptionHandlingCalculator/ExceptionHandlingCalculator.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net10.0 enable diff --git a/ExchangeRatesTextProcessing/ExchangeRatesTextProcessing/ExchangeRatesTextProcessing.csproj b/ExchangeRatesTextProcessing/ExchangeRatesTextProcessing/ExchangeRatesTextProcessing.csproj index d456ff4..3804262 100644 --- a/ExchangeRatesTextProcessing/ExchangeRatesTextProcessing/ExchangeRatesTextProcessing.csproj +++ b/ExchangeRatesTextProcessing/ExchangeRatesTextProcessing/ExchangeRatesTextProcessing.csproj @@ -2,7 +2,7 @@ Exe - net7.0 + net10.0 enable diff --git a/FileReadWrite/FileReadWrite/FileReadWrite.csproj b/FileReadWrite/FileReadWrite/FileReadWrite.csproj index 41f1d5a..3804262 100644 --- a/FileReadWrite/FileReadWrite/FileReadWrite.csproj +++ b/FileReadWrite/FileReadWrite/FileReadWrite.csproj @@ -2,7 +2,8 @@ Exe - net6.0 + net10.0 + enable diff --git a/HadaniCisel/HadaniCisel/HadaniCisel.csproj b/HadaniCisel/HadaniCisel/HadaniCisel.csproj index cb644c6..872e7a5 100644 --- a/HadaniCisel/HadaniCisel/HadaniCisel.csproj +++ b/HadaniCisel/HadaniCisel/HadaniCisel.csproj @@ -2,7 +2,7 @@ Exe - net7.0 + net10.0 enable diff --git a/Hashtable/Hashtable.csproj b/Hashtable/Hashtable.csproj index f873688..3186a32 100644 --- a/Hashtable/Hashtable.csproj +++ b/Hashtable/Hashtable.csproj @@ -2,7 +2,7 @@ Exe - net9.0 + net10.0 enable diff --git a/JackpotGame/JackpotGame/JackpotGame.csproj b/JackpotGame/JackpotGame/JackpotGame.csproj index 958d2f1..3804262 100644 --- a/JackpotGame/JackpotGame/JackpotGame.csproj +++ b/JackpotGame/JackpotGame/JackpotGame.csproj @@ -2,7 +2,8 @@ Exe - netcoreapp3.0 + net10.0 + enable diff --git a/JackpotGame/JackpotGame/Program.cs b/JackpotGame/JackpotGame/Program.cs index 10da872..5a540f1 100644 --- a/JackpotGame/JackpotGame/Program.cs +++ b/JackpotGame/JackpotGame/Program.cs @@ -1,55 +1,43 @@ -using System; -using System.Threading; +Console.Clear(); +int score = 0; +int pokus = 0; -namespace JackpotGame +while (true) { - class Program - { - static void Main(string[] args) - { - Console.Clear(); - int score = 0; - int pokus = 0; - - while (true) - { - int cislo1 = new Random().Next(10); - Console.SetCursorPosition(10, 10); - Console.Write(cislo1); + int cislo1 = new Random().Next(10); + Console.SetCursorPosition(10, 10); + Console.Write(cislo1); - int cislo2 = new Random().Next(10); - Console.SetCursorPosition(20, 10); - Console.Write(cislo2); + int cislo2 = new Random().Next(10); + Console.SetCursorPosition(20, 10); + Console.Write(cislo2); - int cislo3 = new Random().Next(10); - Console.SetCursorPosition(30, 10); - Console.Write(cislo3); + int cislo3 = new Random().Next(10); + Console.SetCursorPosition(30, 10); + Console.Write(cislo3); - if (Console.KeyAvailable) - { - Console.ReadKey(); - - pokus = pokus + 1; + if (Console.KeyAvailable) + { + Console.ReadKey(); - if (cislo1 == cislo2) - { - score = score + 1; - } - if (cislo2 == cislo3) - { - score = score + 1; - } - if (cislo1 == cislo3) - { - score = score + 1; - } + pokus = pokus + 1; - Console.SetCursorPosition(1, 1); - Console.Write($"{score}/{pokus}"); - Console.Beep(); - Thread.Sleep(1000); // 1s - } - } + if (cislo1 == cislo2) + { + score = score + 1; } + if (cislo2 == cislo3) + { + score = score + 1; + } + if (cislo1 == cislo3) + { + score = score + 1; + } + + Console.SetCursorPosition(1, 1); + Console.Write($"{score}/{pokus}"); + Console.Beep(); + Thread.Sleep(1000); // 1s } } diff --git a/KNearestNeighbors/KNearestNeighbors/KNearestNeighbors.csproj b/KNearestNeighbors/KNearestNeighbors/KNearestNeighbors.csproj index f02677b..dfb40ca 100644 --- a/KNearestNeighbors/KNearestNeighbors/KNearestNeighbors.csproj +++ b/KNearestNeighbors/KNearestNeighbors/KNearestNeighbors.csproj @@ -2,7 +2,7 @@ Exe - net7.0 + net10.0 enable enable diff --git a/KNearestNeighbors/KNearestNeighbors/Program.cs b/KNearestNeighbors/KNearestNeighbors/Program.cs index 26e350f..18b9db6 100644 --- a/KNearestNeighbors/KNearestNeighbors/Program.cs +++ b/KNearestNeighbors/KNearestNeighbors/Program.cs @@ -1 +1,2 @@ -// TODO \ No newline at end of file +// TODO: Implement K-Nearest Neighbors algorithm +Console.WriteLine("TODO: K-Nearest Neighbors - not yet implemented."); diff --git a/KnapsackDynamic/KnapsackDynamic.csproj b/KnapsackDynamic/KnapsackDynamic.csproj index 90c53ef..3186a32 100644 --- a/KnapsackDynamic/KnapsackDynamic.csproj +++ b/KnapsackDynamic/KnapsackDynamic.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net10.0 enable diff --git a/KnapsackGreedy/KnapsackGreedy/KnapsackGreedy.csproj b/KnapsackGreedy/KnapsackGreedy/KnapsackGreedy.csproj index 90c53ef..3186a32 100644 --- a/KnapsackGreedy/KnapsackGreedy/KnapsackGreedy.csproj +++ b/KnapsackGreedy/KnapsackGreedy/KnapsackGreedy.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net10.0 enable diff --git a/KnuthMorrisPrattStringSearch/KnuthMorrisPrattStringSearch/KnuthMorrisPrattStringSearch.csproj b/KnuthMorrisPrattStringSearch/KnuthMorrisPrattStringSearch/KnuthMorrisPrattStringSearch.csproj index f873688..3186a32 100644 --- a/KnuthMorrisPrattStringSearch/KnuthMorrisPrattStringSearch/KnuthMorrisPrattStringSearch.csproj +++ b/KnuthMorrisPrattStringSearch/KnuthMorrisPrattStringSearch/KnuthMorrisPrattStringSearch.csproj @@ -2,7 +2,7 @@ Exe - net9.0 + net10.0 enable diff --git a/LeastSquaresRegressionLine/LeastSquaresRegressionLine/LeastSquaresRegressionLine.csproj b/LeastSquaresRegressionLine/LeastSquaresRegressionLine/LeastSquaresRegressionLine.csproj index f02677b..dfb40ca 100644 --- a/LeastSquaresRegressionLine/LeastSquaresRegressionLine/LeastSquaresRegressionLine.csproj +++ b/LeastSquaresRegressionLine/LeastSquaresRegressionLine/LeastSquaresRegressionLine.csproj @@ -2,7 +2,7 @@ Exe - net7.0 + net10.0 enable enable diff --git a/LinkedList/LinkedList/LinkedList.csproj b/LinkedList/LinkedList/LinkedList.csproj index fb76edd..3804262 100644 --- a/LinkedList/LinkedList/LinkedList.csproj +++ b/LinkedList/LinkedList/LinkedList.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net10.0 enable diff --git a/LongestCommonSubsequence/LongestCommonSubsequence/LongestCommonSubsequence.csproj b/LongestCommonSubsequence/LongestCommonSubsequence/LongestCommonSubsequence.csproj index f873688..3186a32 100644 --- a/LongestCommonSubsequence/LongestCommonSubsequence/LongestCommonSubsequence.csproj +++ b/LongestCommonSubsequence/LongestCommonSubsequence/LongestCommonSubsequence.csproj @@ -2,7 +2,7 @@ Exe - net9.0 + net10.0 enable diff --git a/MaxFlow/MaxFlow.csproj b/MaxFlow/MaxFlow.csproj index f873688..3186a32 100644 --- a/MaxFlow/MaxFlow.csproj +++ b/MaxFlow/MaxFlow.csproj @@ -2,7 +2,7 @@ Exe - net9.0 + net10.0 enable diff --git a/MaxObjectSize/MaxObjectSize/MaxObjectSize.csproj b/MaxObjectSize/MaxObjectSize/MaxObjectSize.csproj index 74abf5c..dfb40ca 100644 --- a/MaxObjectSize/MaxObjectSize/MaxObjectSize.csproj +++ b/MaxObjectSize/MaxObjectSize/MaxObjectSize.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net10.0 enable enable diff --git a/Nasobky/Nasobky/Nasobky.csproj b/Nasobky/Nasobky/Nasobky.csproj index cac5673..a2da406 100644 --- a/Nasobky/Nasobky/Nasobky.csproj +++ b/Nasobky/Nasobky/Nasobky.csproj @@ -2,7 +2,7 @@ Exe - net7.0 + net10.0 enable diff --git a/Palindrome/Palindrome/Palindrome.csproj b/Palindrome/Palindrome/Palindrome.csproj index aacdef5..a1d2a45 100644 --- a/Palindrome/Palindrome/Palindrome.csproj +++ b/Palindrome/Palindrome/Palindrome.csproj @@ -2,7 +2,7 @@ Exe - net7.0 + net10.0 enable diff --git a/PolePocitaniCisel/PolePocitaniCisel/PolePocitaniCisel.csproj b/PolePocitaniCisel/PolePocitaniCisel/PolePocitaniCisel.csproj index cb644c6..872e7a5 100644 --- a/PolePocitaniCisel/PolePocitaniCisel/PolePocitaniCisel.csproj +++ b/PolePocitaniCisel/PolePocitaniCisel/PolePocitaniCisel.csproj @@ -2,7 +2,7 @@ Exe - net7.0 + net10.0 enable diff --git a/PrimsMst/PrimsMst.csproj b/PrimsMst/PrimsMst.csproj index 4b52a1b..cd138a4 100644 --- a/PrimsMst/PrimsMst.csproj +++ b/PrimsMst/PrimsMst.csproj @@ -2,7 +2,7 @@ Exe - net9.0 + net10.0 enable enable diff --git a/Prvocisla/Prvocisla/Program.cs b/Prvocisla/Prvocisla/Program.cs index 710d645..ee7f601 100644 --- a/Prvocisla/Prvocisla/Program.cs +++ b/Prvocisla/Prvocisla/Program.cs @@ -1,31 +1,20 @@ -using System; +Console.WriteLine("Zadej číslo"); +int cislo = Convert.ToInt32(Console.ReadLine()); -namespace Prvocisla +int delitel = 2; +while (true) { - class Program + if (cislo % delitel == 0) { - static void Main(string[] args) + if (cislo == delitel) { - Console.WriteLine("Zadej číslo"); - int cislo = Convert.ToInt32(Console.ReadLine()); - - int delitel = 2; - while (true) - { - if (cislo % delitel == 0) - { - if (cislo == delitel) - { - Console.WriteLine("Toto je prvočíslo."); - } - if (delitel < cislo) - { - Console.WriteLine("Toto není prvočíslo."); - } - break; - } - delitel = delitel + 1; - } + Console.WriteLine("Toto je prvočíslo."); + } + if (delitel < cislo) + { + Console.WriteLine("Toto není prvočíslo."); } + break; } + delitel = delitel + 1; } diff --git a/Prvocisla/Prvocisla/Prvocisla.csproj b/Prvocisla/Prvocisla/Prvocisla.csproj index c73e0d1..3804262 100644 --- a/Prvocisla/Prvocisla/Prvocisla.csproj +++ b/Prvocisla/Prvocisla/Prvocisla.csproj @@ -2,7 +2,8 @@ Exe - netcoreapp3.1 + net10.0 + enable diff --git a/RecursionMaxDepth/RecursionMaxDepth/RecursionMaxDepth.csproj b/RecursionMaxDepth/RecursionMaxDepth/RecursionMaxDepth.csproj index 74abf5c..dfb40ca 100644 --- a/RecursionMaxDepth/RecursionMaxDepth/RecursionMaxDepth.csproj +++ b/RecursionMaxDepth/RecursionMaxDepth/RecursionMaxDepth.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net10.0 enable enable diff --git a/ReversePolishNotationCalculator/ReversePolishNotationCalculator/ReversePolishNotationCalculator.csproj b/ReversePolishNotationCalculator/ReversePolishNotationCalculator/ReversePolishNotationCalculator.csproj index 74abf5c..dfb40ca 100644 --- a/ReversePolishNotationCalculator/ReversePolishNotationCalculator/ReversePolishNotationCalculator.csproj +++ b/ReversePolishNotationCalculator/ReversePolishNotationCalculator/ReversePolishNotationCalculator.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net10.0 enable enable diff --git a/RomanNumerals/RomanNumerals/RomanNumerals.csproj b/RomanNumerals/RomanNumerals/RomanNumerals.csproj index 74abf5c..dfb40ca 100644 --- a/RomanNumerals/RomanNumerals/RomanNumerals.csproj +++ b/RomanNumerals/RomanNumerals/RomanNumerals.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net10.0 enable enable diff --git a/Search/Search/Search.csproj b/Search/Search/Search.csproj index d456ff4..3804262 100644 --- a/Search/Search/Search.csproj +++ b/Search/Search/Search.csproj @@ -2,7 +2,7 @@ Exe - net7.0 + net10.0 enable diff --git a/SelfServiceCheckoutQueue/SelfServiceCheckoutQueue/SelfServiceCheckoutQueue.csproj b/SelfServiceCheckoutQueue/SelfServiceCheckoutQueue/SelfServiceCheckoutQueue.csproj index fb76edd..3804262 100644 --- a/SelfServiceCheckoutQueue/SelfServiceCheckoutQueue/SelfServiceCheckoutQueue.csproj +++ b/SelfServiceCheckoutQueue/SelfServiceCheckoutQueue/SelfServiceCheckoutQueue.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net10.0 enable diff --git a/SortingBasics/SortingBasics/SortingBasics.csproj b/SortingBasics/SortingBasics/SortingBasics.csproj index 74abf5c..dfb40ca 100644 --- a/SortingBasics/SortingBasics/SortingBasics.csproj +++ b/SortingBasics/SortingBasics/SortingBasics.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net10.0 enable enable diff --git a/SortingQuickSort/SortingQuickSort.csproj b/SortingQuickSort/SortingQuickSort.csproj index fd4bd08..ed9781c 100644 --- a/SortingQuickSort/SortingQuickSort.csproj +++ b/SortingQuickSort/SortingQuickSort.csproj @@ -2,7 +2,7 @@ Exe - net9.0 + net10.0 enable enable diff --git a/SortingShellSort/SortingShellSort.csproj b/SortingShellSort/SortingShellSort.csproj index f873688..3186a32 100644 --- a/SortingShellSort/SortingShellSort.csproj +++ b/SortingShellSort/SortingShellSort.csproj @@ -2,7 +2,7 @@ Exe - net9.0 + net10.0 enable diff --git a/SqlInjectionDemo/SqlInjectionDemo/Program.cs b/SqlInjectionDemo/SqlInjectionDemo/Program.cs index 87e1335..2e868d3 100644 --- a/SqlInjectionDemo/SqlInjectionDemo/Program.cs +++ b/SqlInjectionDemo/SqlInjectionDemo/Program.cs @@ -1,33 +1,23 @@ -using Microsoft.VisualBasic.CompilerServices; -using System; +using Microsoft.VisualBasic.CompilerServices; using System.Data.SqlClient; -namespace SqlInjectionDemo -{ - class Program - { - static void Main(string[] args) - { - Console.WriteLine("Username:"); - var username = Console.ReadLine(); +Console.WriteLine("Username:"); +var username = Console.ReadLine(); - Console.WriteLine("Password:"); - var password = Console.ReadLine(); +Console.WriteLine("Password:"); +var password = Console.ReadLine(); - // SELECT UserID FROM User WHERE Username='pepa' AND Password = 'hesllo' - string cmdText = "SELECT UserId FROM [User] WHERE Username=@username AND Password=@password"; - Console.WriteLine(cmdText); +// SELECT UserID FROM User WHERE Username='pepa' AND Password = 'hesllo' +string cmdText = "SELECT UserId FROM [User] WHERE Username=@username AND Password=@password"; +Console.WriteLine(cmdText); - using var conn = new SqlConnection("Server=rhdemosql.database.windows.net;Database=AdventureWorksLT;User Id=PrgStudent;Password=Karel je borec.;"); - conn.Open(); - using var cmd = new SqlCommand(cmdText, conn); - cmd.Parameters.AddWithValue("username", username); - cmd.Parameters.AddWithValue("password", password); +using var conn = new SqlConnection("Server=rhdemosql.database.windows.net;Database=AdventureWorksLT;User Id=PrgStudent;Password=Karel je borec.;"); +conn.Open(); +using var cmd = new SqlCommand(cmdText, conn); +cmd.Parameters.AddWithValue("username", username); +cmd.Parameters.AddWithValue("password", password); - var userID = cmd.ExecuteScalar(); - Console.Write("ID přihlášeného uživatele:"); - Console.WriteLine(userID); - } - } -} +var userID = cmd.ExecuteScalar(); +Console.Write("ID přihlášeného uživatele:"); +Console.WriteLine(userID); diff --git a/SqlInjectionDemo/SqlInjectionDemo/SqlInjectionDemo.csproj b/SqlInjectionDemo/SqlInjectionDemo/SqlInjectionDemo.csproj index 37a28ad..a6aef07 100644 --- a/SqlInjectionDemo/SqlInjectionDemo/SqlInjectionDemo.csproj +++ b/SqlInjectionDemo/SqlInjectionDemo/SqlInjectionDemo.csproj @@ -2,7 +2,8 @@ Exe - netcoreapp3.1 + net10.0 + enable diff --git a/StringLetterCount/StringLetterCount/StringLetterCount.csproj b/StringLetterCount/StringLetterCount/StringLetterCount.csproj index 70eaf9d..a5fdf73 100644 --- a/StringLetterCount/StringLetterCount/StringLetterCount.csproj +++ b/StringLetterCount/StringLetterCount/StringLetterCount.csproj @@ -2,7 +2,8 @@ Exe - netcoreapp3.1 + net10.0 + enable diff --git a/UniqueNumber/UniqueNumber/UniqueNumber.csproj b/UniqueNumber/UniqueNumber/UniqueNumber.csproj index 74abf5c..dfb40ca 100644 --- a/UniqueNumber/UniqueNumber/UniqueNumber.csproj +++ b/UniqueNumber/UniqueNumber/UniqueNumber.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net10.0 enable enable diff --git a/VigenereCipher/VigenereCipher/VigenereCipher.csproj b/VigenereCipher/VigenereCipher/VigenereCipher.csproj index 74abf5c..dfb40ca 100644 --- a/VigenereCipher/VigenereCipher/VigenereCipher.csproj +++ b/VigenereCipher/VigenereCipher/VigenereCipher.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net10.0 enable enable diff --git a/Vlnky/Vlnky/Program.cs b/Vlnky/Vlnky/Program.cs index 41901f7..813d61e 100644 --- a/Vlnky/Vlnky/Program.cs +++ b/Vlnky/Vlnky/Program.cs @@ -1,36 +1,24 @@ -using System; -using System.Threading; - -namespace Vlnky +int posun = 1; +int smer = 1; +while (true) { - class Program + if ((posun > 0) && (posun < 11)) + { + posun = posun + smer; + } + for (int i = 0; i < posun; i++) { - static void Main(string[] args) - { - int posun = 1; - int smer = 1; - while (true) - { - if ((posun > 0) && (posun < 11)) - { - posun = posun + smer; - } - for (int i = 0; i < posun; i++) - { - Console.Write(" "); - } - Console.WriteLine("O"); - Thread.Sleep(100); + Console.Write(" "); + } + Console.WriteLine("O"); + Thread.Sleep(100); - if (posun == 10) - { - smer = -1; - } - if (posun == 1) - { - smer = 1; - } - } - } + if (posun == 10) + { + smer = -1; + } + if (posun == 1) + { + smer = 1; } } diff --git a/Vlnky/Vlnky/Vlnky.csproj b/Vlnky/Vlnky/Vlnky.csproj index c73e0d1..3804262 100644 --- a/Vlnky/Vlnky/Vlnky.csproj +++ b/Vlnky/Vlnky/Vlnky.csproj @@ -2,7 +2,8 @@ Exe - netcoreapp3.1 + net10.0 + enable diff --git a/WebDownloader/WebDownloader/Program.cs b/WebDownloader/WebDownloader/Program.cs index ab0d3e3..4a03e2d 100644 --- a/WebDownloader/WebDownloader/Program.cs +++ b/WebDownloader/WebDownloader/Program.cs @@ -1,28 +1,16 @@ -using System; -using System.IO; -using System.Net.Http; using System.Text.RegularExpressions; -namespace WebDownloader -{ - public class Program - { - public static void Main(string[] args) - { - HttpClient client = new HttpClient(); - string stranka = client.GetStringAsync("https://www.mensagymnazium.cz/cs/kontakty").Result; - - Regex re = new Regex(@"(?.*)"); - foreach (Match match in re.Matches(stranka)) - { - Console.WriteLine(match.Groups["jmeno"]); - } +HttpClient client = new HttpClient(); +string stranka = client.GetStringAsync("https://www.mensagymnazium.cz/cs/kontakty").Result; - //Console.WriteLine(stranka); - } - } +Regex re = new Regex(@"(?.*)"); +foreach (Match match in re.Matches(stranka)) +{ + Console.WriteLine(match.Groups["jmeno"]); } +//Console.WriteLine(stranka); + // HttpRequestMessage request = new HttpRequestMessage(); // request.Method = HttpMethod.Get; // request.Headers.Add("User-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36 Edg/83.0.478.44"); diff --git a/WebDownloader/WebDownloader/WebDownloader.csproj b/WebDownloader/WebDownloader/WebDownloader.csproj index c73e0d1..3804262 100644 --- a/WebDownloader/WebDownloader/WebDownloader.csproj +++ b/WebDownloader/WebDownloader/WebDownloader.csproj @@ -2,7 +2,8 @@ Exe - netcoreapp3.1 + net10.0 + enable diff --git a/WebHadaniCisel/WebHadaniCisel/Program.cs b/WebHadaniCisel/WebHadaniCisel/Program.cs index 8bb95c7..6d416a7 100644 --- a/WebHadaniCisel/WebHadaniCisel/Program.cs +++ b/WebHadaniCisel/WebHadaniCisel/Program.cs @@ -1,28 +1,11 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; +using WebHadaniCisel; -namespace WebHadaniCisel -{ - public class Program +var builder = Host.CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => { - public static void Main(string[] args) - { - CreateHostBuilder(args).Build().Run(); - } + webBuilder.UseStartup(); + }); - public static IHostBuilder CreateHostBuilder(string[] args) => - Host.CreateDefaultBuilder(args) - .ConfigureWebHostDefaults(webBuilder => - { - webBuilder.UseStartup(); - }); - } -} +builder.Build().Run(); diff --git a/WebHadaniCisel/WebHadaniCisel/WebHadaniCisel.csproj b/WebHadaniCisel/WebHadaniCisel/WebHadaniCisel.csproj index 92605c5..45287e3 100644 --- a/WebHadaniCisel/WebHadaniCisel/WebHadaniCisel.csproj +++ b/WebHadaniCisel/WebHadaniCisel/WebHadaniCisel.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1 + net10.0 diff --git a/WebKalkulator/WebKalkulator/Program.cs b/WebKalkulator/WebKalkulator/Program.cs index cdeffdd..f9df3b5 100644 --- a/WebKalkulator/WebKalkulator/Program.cs +++ b/WebKalkulator/WebKalkulator/Program.cs @@ -1,28 +1,11 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; +using WebKalkulator; -namespace WebKalkulator -{ - public class Program +var builder = Host.CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => { - public static void Main(string[] args) - { - CreateHostBuilder(args).Build().Run(); - } + webBuilder.UseStartup(); + }); - public static IHostBuilder CreateHostBuilder(string[] args) => - Host.CreateDefaultBuilder(args) - .ConfigureWebHostDefaults(webBuilder => - { - webBuilder.UseStartup(); - }); - } -} +builder.Build().Run(); diff --git a/WebKalkulator/WebKalkulator/WebKalkulator.csproj b/WebKalkulator/WebKalkulator/WebKalkulator.csproj index 92605c5..45287e3 100644 --- a/WebKalkulator/WebKalkulator/WebKalkulator.csproj +++ b/WebKalkulator/WebKalkulator/WebKalkulator.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1 + net10.0 diff --git a/WebPole/WebPole/Program.cs b/WebPole/WebPole/Program.cs index 6cd475f..a80b8a6 100644 --- a/WebPole/WebPole/Program.cs +++ b/WebPole/WebPole/Program.cs @@ -1,28 +1,11 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; +using WebPole; -namespace WebPole -{ - public class Program +var builder = Host.CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => { - public static void Main(string[] args) - { - CreateHostBuilder(args).Build().Run(); - } + webBuilder.UseStartup(); + }); - public static IHostBuilder CreateHostBuilder(string[] args) => - Host.CreateDefaultBuilder(args) - .ConfigureWebHostDefaults(webBuilder => - { - webBuilder.UseStartup(); - }); - } -} +builder.Build().Run(); diff --git a/WebPole/WebPole/WebPole.csproj b/WebPole/WebPole/WebPole.csproj index 92605c5..45287e3 100644 --- a/WebPole/WebPole/WebPole.csproj +++ b/WebPole/WebPole/WebPole.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1 + net10.0