Creat a Text File in C#
Hi guys ! In this tutorial we learn how to create text file in c# using Stream Writer
Lets start ,write the following cod in visual studio project:
Code
StreamWriter st = new StreamWriter("E:/Test.text");
Console.WriteLine("Please Write something...");string s = Console.ReadLine();
st.WriteLine(s.ToString());
st.Close();
Output
Now go to E drive .Here Text File created.
Comments
Post a Comment