Write byte to a text file in CSharp

Description

The following code shows how to write byte to a text file.

Example


  /*from   www.j  a  v a2 s  . co  m*/

using System;
using System.IO;

public class MainClass
{
  static void Main(string[] args)
  {

    FileInfo MyFiles = new FileInfo(@"c:\Testing.txt");
    FileStream MyFileStream1 = MyFiles.OpenWrite();

    byte MyWriteByte = 100;

    MyFileStream1.WriteByte(MyWriteByte);
    
    MyFileStream1.Close();    
  }
}




















Home »
  C# Tutorial »
    IO »




File Attribute
File Security
Directory Attribute
Directory Recursive
Binary File
Text Field
Buffered IO
Create Copy Delete Move
CSV
Drive
File System Watcher
Isolated Storage
MemoryStream
Serialize
Zip