private void WriteToDisk() { var jsonString = JsonConvert.SerializeObject(new ConfigFileStruct() { Keys = HostKeys.ToDictionary(x => x.Key, x => x.Value) }, Formatting.Indented ); File.WriteAllText(FileName, jsonString); }
private void WriteToDisk() { var jsonString = JsonConvert.SerializeObject(new ConfigFileStruct() { Keys = HostKeys.ToDictionary(x => x.Key, x => x.Value) }, Formatting.Indented ); var d = Directory.CreateDirectory(Path.GetDirectoryName(FileName)); if (d.Exists) { File.WriteAllText(FileName, jsonString); } }