FolderScanToTxt 1.0.0
dotnet add package FolderScanToTxt --version 1.0.0
NuGet\Install-Package FolderScanToTxt -Version 1.0.0
<PackageReference Include="FolderScanToTxt" Version="1.0.0" />
<PackageVersion Include="FolderScanToTxt" Version="1.0.0" />
<PackageReference Include="FolderScanToTxt" />
paket add FolderScanToTxt --version 1.0.0
#r "nuget: FolderScanToTxt, 1.0.0"
#:package FolderScanToTxt@1.0.0
#addin nuget:?package=FolderScanToTxt&version=1.0.0
#tool nuget:?package=FolderScanToTxt&version=1.0.0
FolderScanToTxt
FolderScanToTxt is a lightweight .NET library for scanning directories, filtering files/folders, and exporting the structure to a text file. It is designed to be UI-agnostic, so you can use it in console apps, desktop apps, or web applications.
Quick Start
using FolderScanToTxt;
class Program
{
static void Main()
{
var options = new FolderScanOptions
{
IncludeHidden = false,
FileTypeFilter = ".txt",
ExcludeFileName1 = "app.exe",
ExcludeFileName2 = "folder-contents.txt"
};
var result = FolderScannerService.ScanAndSave(
baseDirectory: @"C:\MyFolder",
outputFileName: "folder-contents.txt",
options: options
);
Console.WriteLine($"Done! Files: {result.FileCount}, Folders: {result.FolderCount}");
}
}
Features
- Scan directories and list all files/folders.
- Optionally include or exclude hidden files/folders.
- Filter by specific file type (e.g., .txt, .mp3).
- Exclude specific files (e.g., the scanner’s own executable).
- Save results to a .txt file.
- Optional console helpers for interactive prompts.
Installation
From NuGet.org
dotnet add package FolderScanToTxt
Then install:
dotnet add package FolderScanToTxt
Usage
Using Console Helpers (Optional)
bool includeHidden = ConsoleHelpers.PromptHiddenFiles();
string? filter = ConsoleHelpers.PromptFileType();
var options = new FolderScanOptions
{
IncludeHidden = includeHidden,
FileTypeFilter = filter,
ExcludeFileName1 = "app.exe",
ExcludeFileName2 = "folder-contents.txt"
};
FolderScannerService.ScanAndSave(@"C:\MyFolder", "folder-contents.txt", options);
You can also check a console project that uses this library at: FolderToTxt
Output Example
MyFolder/
├── doc.txt
├── image.png
└── SubFolder/
├── notes.txt
└── song.mp3
The exported folder-contents.txt might look like:
SubFolder/
../notes.txt
../song.mp3
doc.txt
image.png
API Overview
FolderScanToTxt
- ScanAndSave(string baseDirectory, string outputFileName, FolderScanOptions options)
FolderScanOptions
- bool IncludeHidden → include hidden files/folders.
- string? FileTypeFilter → e.g. .txt or .mp3.
- string? ExcludeFileName1, ExcludeFileName2 → filenames to skip.
FolderScanResult
- int FileCount
- int FolderCount
- string OutputPath
ConsoleHelpers (Optional)
- PromptHiddenFiles(string message = "...")
- PromptFileType(string message = "...")
License
MIT License. See LICENSE
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 192 | 9/2/2025 |