how to write " how are you " in a text file and read the file and display the contents..can anyone tell me the code for this?

need namespace System.IO
//Create and write in file
StreamWriter sw = File.CreateText("Pathoffile");
                    sw.WriteLine("Name,Mobile,Land Line,Address,Pincode,Email");
                    sw.WriteLine("Jak");
                    sw.Close();
//read file
StreamReader sr = new StreamReader("Path");
                    string str= sr.ReadToEnd();
                    sr.Close();

Thank you JakShelar.
it really helped a lot :)
Zosk

thank u so much for ur help

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.