Created
February 22, 2018 03:35
-
-
Save longtth/5f94ccf6c971ffa80784ebf19a4a04b0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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