write the contents of person in a file
FirstName: Abcd
SecondName: Tsfsdfs
For this I wrote a sample application
namespace BinaryStream
{
class Program
{
static void Main(string[] args)
{
StreamWriter binWriter = new StreamWriter(@"c:\happybirthday.txt");
string name = "Sachin";
string secondname = "tendulkar";
string wishes = "happy birthday";
string firstname = string.Format("FirstName: {0} \n", name);
binWriter.Write(firstname);
string sn = string.Format("SecondName: {0} \n", secondname);
binWriter.Write(sn);
binWriter.Close();
}
}
}
IF I open the contents in the notepad, the strings are not displayed in the next line What is the reason for this? Is the format part is correct?