Skip to content

Instantly share code, notes, and snippets.

@longtth
Created February 22, 2018 03:35
Show Gist options
  • Save longtth/5f94ccf6c971ffa80784ebf19a4a04b0 to your computer and use it in GitHub Desktop.
Save longtth/5f94ccf6c971ffa80784ebf19a4a04b0 to your computer and use it in GitHub Desktop.
public void WriteToFile(string filePath, List<Honda2ObjFinal> list)
{
string json = JsonConvert.SerializeObject(list, Formatting.Indented);
// cái đoạn code dùng StreamWriter này éo biết vì sao sẽ hỏng đi 300 line cuối cùng.
//FileStream fs = new FileStream(filePath, FileMode.CreateNew);
//Encoding utf8WithoutBom = new UTF8Encoding(false);
//StreamWriter sw = new StreamWriter(fs, utf8WithoutBom);
//sw.Write(json);
File.WriteAllText(filePath, json);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment