AppFiles 1.1.3

dotnet add package AppFiles --version 1.1.3
NuGet\Install-Package AppFiles -Version 1.1.3
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AppFiles" Version="1.1.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AppFiles --version 1.1.3
#r "nuget: AppFiles, 1.1.3"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install AppFiles as a Cake Addin
#addin nuget:?package=AppFiles&version=1.1.3

// Install AppFiles as a Cake Tool
#tool nuget:?package=AppFiles&version=1.1.3

Application Files Manager for .NET Applications

This is a simple application that allows you to manage your .NET applications files. Import this application into your project using NuGet with one of the following methods:

  • Package Manager: Install-Package AppFiles
  • .NET CLI: dotnet add package AppFiles
  • Package Reference: <PackageReference Include="AppFiles" Version="1.1.3" />

Usage

This library contains a single publicly exposed class, AppFileManager. This class should be instantiated in your application and then used to access the files in your application. The constructor of this class takes the following parameters:

  • string appName: The name of your application. This is used to create a folder in the company folder created in the user's AppData folder to store your application's files.
  • string company: The name of your company. This is used to create a folder in the user's AppData folder to store your application folders.
  • string appsRoot: (optional) This is the root to store your company folder in. This defaults to the user's AppData folder, but can be changed to any folder you want. NOTE: This folder must exist before you instantiate the AppFileManager class.

Example:

var manager = new AppFileManager("My Application", 
                            "My Company");

// Create an application text file
manager.SaveTextFile("MyFile.txt", 
                      "This is the contents of my file.");
// C:\Users\MyUser\AppData\Local\My Company\My Application\MyFile.txt

// Create an application binary file in an optional subfolder
manager.SaveBinaryFile("MyFile.bin", 
                        new byte[] { 0x00, 0x01, 0x02, 0x03 }, 
                        subfolderPath: "path/to/subfolder");
// C:\Users\MyUser\AppData\Local\My Company\My Application\path\to\subfolder\MyFile.bin

// Get the contents of the subfolder binary file
var bytes = manager.LoadBinaryFile("MyFile.bin", 
                                    subfolderPath: "path/to/subfolder");
// bytes = { 0x00, 0x01, 0x02, 0x03 }

// List all binary files in the subfolder
var files = manager.ListDirectory(subfolderPath: "path/to/subfolder", 
                                   pattern: "*.bin");
// files = { "C:\Users\MyUser\AppData\Local\My Company\My Application\path\to\subfolder\MyFile.bin" }

Publishing

To publish this library, you must be authenticated to NuGet with the nuget.org source and have the appropriate access key setup. Then, from the repository root, run the ./tools/PublishNuGet

License

MIT

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.1.3 219 3/29/2023
1.1.2 162 3/29/2023
1.0.5 172 3/27/2023
1.0.4 161 3/27/2023
1.0.3 162 3/27/2023
1.0.2 157 3/27/2023
1.0.1 165 3/27/2023
1.0.0 168 3/27/2023