Streamwriter
-
Hi all I'm just after general examples dealing with streamwriter appendtext examples. I have had a look around microsoft and of course Code Project but can't find much to help. I am old and ready for the knackers yard, but still trying. I use the MSDN in Miscrosoft, but sometimes i find it more confusing than helpful. Can anyone just give me general guidance? Thanks Zeldacat
Regards Zeldacat
-
Hi all I'm just after general examples dealing with streamwriter appendtext examples. I have had a look around microsoft and of course Code Project but can't find much to help. I am old and ready for the knackers yard, but still trying. I use the MSDN in Miscrosoft, but sometimes i find it more confusing than helpful. Can anyone just give me general guidance? Thanks Zeldacat
Regards Zeldacat
Hi Zeldacat, .NET has some really cool support for many things, among which are Streams. A Stream is ultimately derived from the System.IO.Stream Class. Please know that StreamWriter Class Implements a TextWriter for writing characters to a stream in a particular encoding. StreamWriter defaults to using an instance of UTF8Encoding unless specified otherwise. This instance of UTF8Encoding is constructed such that the Encoding.GetPreamble method returns the Unicode byte order mark written in UTF-8. The preamble of the encoding is added to a stream when you are not appending to an existing stream. This means any text file you create with StreamWriter will have three byte order marks at its beginning. UTF-8 handles all Unicode characters correctly and gives consistent results on localized versions of the operating system. I would suggest you to go through the following articles for more information regarding StreamWriter class. http://www.knowdotnet.com/articles/streams1_4.html http://msdn2.microsoft.com/en-us/library/system.io.streamwriter(VS.71).aspx http://www.exforsys.com/tutorials/vb.net-2005/access-and-manipulate-data-working-with-disk-files/1.html I hope these articles will help you to understand the concept and functionality of StreamWriter class. Have a nice day :).
Regards, John Adams ComponentOne LLC
-
Hi Zeldacat, .NET has some really cool support for many things, among which are Streams. A Stream is ultimately derived from the System.IO.Stream Class. Please know that StreamWriter Class Implements a TextWriter for writing characters to a stream in a particular encoding. StreamWriter defaults to using an instance of UTF8Encoding unless specified otherwise. This instance of UTF8Encoding is constructed such that the Encoding.GetPreamble method returns the Unicode byte order mark written in UTF-8. The preamble of the encoding is added to a stream when you are not appending to an existing stream. This means any text file you create with StreamWriter will have three byte order marks at its beginning. UTF-8 handles all Unicode characters correctly and gives consistent results on localized versions of the operating system. I would suggest you to go through the following articles for more information regarding StreamWriter class. http://www.knowdotnet.com/articles/streams1_4.html http://msdn2.microsoft.com/en-us/library/system.io.streamwriter(VS.71).aspx http://www.exforsys.com/tutorials/vb.net-2005/access-and-manipulate-data-working-with-disk-files/1.html I hope these articles will help you to understand the concept and functionality of StreamWriter class. Have a nice day :).
Regards, John Adams ComponentOne LLC
Thanks John for the info. It is the sort of info i needed to look at before i tried again Regards Lawrence Zeldacat
Regards Zeldacat