Click here to Skip to main content
15,606,569 members
Please Sign up or sign in to vote.
3.67/5 (3 votes)
See more:
How can I write a text file from .net 2008 in windows 7 ?
Updated 7-Feb-12 1:02am
Varun Sareen 7-Feb-12 6:55am    
Do google search dear friend. Don't post queries on this forum which are obvious to found on google.

For Windows application you need to run the .exe file with Run As Administrator or Give R/W rights to folder on which you are trying to do the write file operation.
For Web Application you need to provide R/W permission to IUser and if possible give R/W rights to everyone.
Share this answer
Dim lines As String() = New String() {"Line one", "line two", "I'm bored now"}
File.WriteAllLines(path, lines)
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900