When we use isolated storage in c# we have two functions from isoFileWriter. can someone explain the difference between isoFileWriter.Write() and isoFileWriter.WriteLine()
I am using below code:
IsolatedStorageFile myspace = IsolatedStorageFile.GetUserStoreForApplication();
myspace.CreateDirectory("Emotions");
using (var isoFileStream = new IsolatedStorageFileStream("Emotions\\history.txt", FileMode.OpenOrCreate, myspace))
{
using (var isoFileWriter = new StreamWriter(isoFileStream))
{
isoFileWriter.WriteLine();
}
}
This is StreamWriter.Write and StreamWriter.WriteLine.
The main difference between the two methods is that
WriteLinewill write a new line to the file, whereWritewill just write the data (without a new line character).Calling
isoFileWriter.WriteLine()will just write a new line to the file. If you were to callWriteLinewhile passing a parameter, ie:isoFileWriter.WriteLine("Foo"), it would writeFoofollowed by a new line.isoFileWriter.Write("Foo"), on the other hand, would just writeFoowithout the new line character.