Пример #1
0
        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();
        }
Пример #2
0
        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();
        }