Write a single line of code to create a text file and write contents into it.

 Posted by Raja on 9/8/2008 | Category: C# Interview questions | Views: 4799
Answer:

Use following code

System.IO.File.WriteAllText(@"c:\MyTextFile.txt", "MyContents");


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response