Connecting Tech Pros Worldwide Forums | Help | Site Map

writing in to the file

Newbie
 
Join Date: Nov 2006
Posts: 3
#1: Nov 9 '06
Hi,
below is the code for writing in to the file.I am using C# for coding purpose.

Expand|Select|Wrap|Line Numbers
  1. // Create the file.
  2.         using (FileStream fs = File.Create(path, 1024)) 
  3.         {
  4.             Byte[] info = new UTF8Encoding(true).GetBytes("This is some text in the file.");
  5.             // Add some information to the file.
  6.             fs.Write(info, 0, info.Length);
  7.         }
  8.  
in this case..
what is the advantage/disadvantage of using Byte array?

Thanks

Reply


Similar .NET Framework bytes