I want to write to a file asynchronously so I've got the following C# code
in a console app:



static void Main(string[] args)

{

      FileStream fStream = new FileStream("Data.ini", FileMode.Append,
FileAccess.Write, FileShare.None, 4096, true);

      byte[] buffer = new byte[128];

      String str = "Hello World" + "\n";

      buffer = Encoding.ASCII.GetBytes(str);



      // Asynchronously write to the file.

      IAsyncResult asyncResult = fStream.BeginWrite(buffer,0,buffer.Length,
null, null);

}



I'm appending a "\n" to my "Hello World" string because I want it on a new
line every time.

The strings end up on the same line with little rectangles in between. When
I copy that over here it looks fine:



Hello World

Hello World






===================================
This list is hosted by DevelopMentor®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to