public static void WriteTextFile(string filePath, string data) { XCSharp.MakeDir(Path.GetDirectoryName(filePath)); TextWriter writer = new StreamWriter(filePath, false, Encoding.UTF8); writer.Write(data); writer.Flush(); writer.Close(); }
public static void WriteBytesFile(string filePath, byte[] data, int offset, int count) { XCSharp.MakeDir(Path.GetDirectoryName(filePath)); FileStream stream = File.OpenWrite(filePath); stream.Write(data, offset, count); stream.Flush(); stream.Close(); }