UtilityPack.FileManager 1.0.9

There is a newer version of this package available.
See the version list below for details.
dotnet add package UtilityPack.FileManager --version 1.0.9                
NuGet\Install-Package UtilityPack.FileManager -Version 1.0.9                
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="UtilityPack.FileManager" Version="1.0.9" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add UtilityPack.FileManager --version 1.0.9                
#r "nuget: UtilityPack.FileManager, 1.0.9"                
#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 UtilityPack.FileManager as a Cake Addin
#addin nuget:?package=UtilityPack.FileManager&version=1.0.9

// Install UtilityPack.FileManager as a Cake Tool
#tool nuget:?package=UtilityPack.FileManager&version=1.0.9                

FileManager

This package offer different static classes to manage data across file types, it currently support:

  • Writing and Reading CSV
  • Writing and Reading INI
  • Reading Windows Registry

Class CsvManager

Property

  • delimiter : public string
    Delimiter used to separate columns in the csv files. (Deafault 😉

  • culture : public CultureInfo
    Culture to write csv files

  • createFolders : public bool
    If true create every unexisting directory when passing a csv path. (Deafault true)

Methods

  • Read< T >(string path) : List< T >
    Create a list of values reading them from a csv file

  • Write< T >(string path, List< T > prodotti) : string
    Write a list of instance to a csv file

  • Write< T, M >(string path, List< T > prodotti) : string
    Write a list of instance to a csv file, with a specific class map to define specific behaviour

Example

	// Change settings
	CsvManager.delimiter = ",";
	
	// Define and create an instance to rappresent a csv row
	class Item
	{
		public string Name;
		public int Age;
	} 
	
	List<Item> list = new();

	// Read the csv content from file and create a list
	list = CsvManager.Read<Item>("C:\example.csv");

	// Modify the list and save it back as csv
	list.RemoveAt(0);
	
	CsvManager.Write<Item>("C:\example.csv", list);
	

Class IniManager

Property

  • printErrors : public bool
    If true print errors, when a file is not found or a section or key are missing

  • forceWrite : public bool
    If true create section and key when they are not found during writing

Methods

  • Read< T >(string filePath, string section, string key, T defaul) : T
    Read a value from a file ini, if some error occours return the default value passed instead

  • Write(string filePath, string section, string key, object value) : bool
    Read a value from a file ini, if some error occours return the default value passed instead

Example

	// Change settings
	IniManager.forceWrite = true;

	// Read a value from a specific ini section and key
	int value = IniManager.Read<int>("C:\example.ini", "admin", "login", 0);

	// Modify the value and save it back as ini
	value += 1
	
	IniManager.Write("C:\example.ini", "admin", "login", value);

Class RegistryManager

Methods

  • Read(RegistryHive root, string key, string subKey) : string
    Read a value from a specific section of the registry

Example

	// Read a value from a key of the registry
	string value = RegistryManager.Read(RegistryHive.LocalMachine, "admin", "login");	
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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.2 331 11/28/2023
1.1.1 708 5/16/2022
1.1.0 667 5/16/2022
1.0.9 703 5/16/2022
1.0.8 692 5/16/2022
1.0.7 735 4/7/2022
1.0.6 725 4/7/2022
1.0.5 694 3/29/2022
1.0.4 686 3/25/2022
1.0.3 693 3/25/2022
1.0.2 688 3/25/2022
1.0.1 686 3/4/2022
1.0.0 695 3/4/2022