From 100f11fd049418a5cee78fe780a30e873a35cd50 Mon Sep 17 00:00:00 2001 From: totinaster <54626756+totinaster@users.noreply.github.com> Date: Tue, 14 Mar 2023 16:14:04 +0100 Subject: [PATCH] 14032023 --- .vscode/launch.json | 26 +++++++++++++++++++++++ .vscode/tasks.json | 41 +++++++++++++++++++++++++++++++++++++ Program.cs | 24 ++++++++++++++++++++++ mslearn-dotnet-files.csproj | 11 ++++++++++ 4 files changed, 102 insertions(+) create mode 100644 .vscode/launch.json create mode 100644 .vscode/tasks.json create mode 100644 Program.cs create mode 100644 mslearn-dotnet-files.csproj diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..d88d265 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,26 @@ +{ + "version": "0.2.0", + "configurations": [ + { + // Use IntelliSense to find out which attributes exist for C# debugging + // Use hover for the description of the existing attributes + // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md + "name": ".NET Core Launch (console)", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build", + // If you have changed target frameworks, make sure to update the program path. + "program": "${workspaceFolder}/bin/Debug/net6.0/mslearn-dotnet-files.dll", + "args": [], + "cwd": "${workspaceFolder}", + // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console + "console": "internalConsole", + "stopAtEntry": false + }, + { + "name": ".NET Core Attach", + "type": "coreclr", + "request": "attach" + } + ] +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..b093081 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,41 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "build", + "command": "dotnet", + "type": "process", + "args": [ + "build", + "${workspaceFolder}/mslearn-dotnet-files.csproj", + "/property:GenerateFullPaths=true", + "/consoleloggerparameters:NoSummary" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "publish", + "command": "dotnet", + "type": "process", + "args": [ + "publish", + "${workspaceFolder}/mslearn-dotnet-files.csproj", + "/property:GenerateFullPaths=true", + "/consoleloggerparameters:NoSummary" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "watch", + "command": "dotnet", + "type": "process", + "args": [ + "watch", + "run", + "--project", + "${workspaceFolder}/mslearn-dotnet-files.csproj" + ], + "problemMatcher": "$msCompile" + } + ] +} \ No newline at end of file diff --git a/Program.cs b/Program.cs new file mode 100644 index 0000000..01360e3 --- /dev/null +++ b/Program.cs @@ -0,0 +1,24 @@ +using System.IO; +using System.Collections.Generic; + +IEnumerable FindFiles(string folderName) +{ + List salesFiles = new List(); + + var foundFiles = Directory.EnumerateFiles(folderName, "*", SearchOption.AllDirectories); + + foreach (var file in foundFiles) + { + if (file.EndsWith("sales.json")) + { + salesFiles.Add(file); + } + } + return salesFiles; +} +var salesFiles = FindFiles("stores"); + +foreach (var file in salesFiles) +{ + Console.WriteLine(file); +} \ No newline at end of file diff --git a/mslearn-dotnet-files.csproj b/mslearn-dotnet-files.csproj new file mode 100644 index 0000000..a793867 --- /dev/null +++ b/mslearn-dotnet-files.csproj @@ -0,0 +1,11 @@ + + + + Exe + net6.0 + mslearn_dotnet_files + enable + enable + + +