c# save dictionary to file code example
Example 1: how to save a c# dictionary
File.WriteAllText("SomeFile.Txt", new JavaScriptSerializer().Serialize(dictionary));
Example 2: how to save a dictionary as a csv file in c#
String csv = String.Join(
Environment.NewLine,
data.Select(d => $"{d.Key};{d.Value};")
);
System.IO.File.WriteAllText(pathToCsv, csv);