Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB9.0
How can I write a text file from .net 2008 in windows 7 ?
Posted 7-Feb-12 1:52am
Edited 7-Feb-12 2:02am
v2
Comments
Varun Sareen at 7-Feb-12 6:55am
   
Do google search dear friend. Don't post queries on this forum which are obvious to found on google.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Try:
Dim lines As String() = New String() {"Line one", "line two", "I'm bored now"}
File.WriteAllLines(path, lines)
  Permalink  

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



Advertise | Privacy | Mobile
Web04 | 2.8.141220.1 | Last Updated 7 Feb 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100