🧠 Learn how to build a powerful C# console application that scans a directory, finds all .cs and .csx files, and extracts their content into a single, well-formatted output file. This tool is perfect for code documentation, backups, audits, or preparing files for code review.
📌 What You'll Learn in This Video:
✅ How to scan directories and subdirectories recursively in C#
✅ How to read and write text files using System.IO and StringBuilder
✅ How to handle errors gracefully during file operations
✅ How to generate readable reports including metadata (filename, size, last modified)
✅ How to create a utility that's both useful and easy to reuse or expand
🧾 Full Source Code on GitHub:
🔗 https://github.com/benjaminsqlserver/...
Explore, fork, or contribute to the project! The repository contains the complete code with comments and sample usage.
🛠️ Prerequisites:
Basic knowledge of C# and .NET
Visual Studio or any C# IDE
.NET SDK installed
🚀 Run the Tool in Two Ways:
Command Line:
bash
Copy
Edit
CodeExtractor.exe "C:\MyProjects" "C:\Output\MyExtractedCode.txt"
Interactive Mode (No Args):
Just run CodeExtractor.exe and follow the prompts in the console.
📂 Output Includes:
Full list of scanned C# files
Clean code content from each file
Metadata: filename, full path, file size, modified timestamp
Summary of total files found and successfully processed
💬 Stay Connected:
If you found this video helpful, please like, subscribe, and drop a comment below.
Have ideas or want new features added to the extractor? Feel free to open an issue or pull request on GitHub!