Solved

StreamWriter question

Posted on 2010-09-18
5
361 Views
Last Modified: 2012-05-10
Does this line of code:

m_LogFile = New StreamWriter(m_LogFolder & m_LogFileName)

overwrite the file if the file already exists? If so, how would you open "to append" instead of overwriting?
0
Comment
Question by:lee88
  • 3
5 Comments
 
LVL 10

Accepted Solution

by:
joriszwaenepoel earned 500 total points
ID: 33709241
Add True as value for the second argument.

m_LogFile = New StreamWriter(m_LogFolder & m_LogFileName, True)

http://msdn.microsoft.com/en-us/library/36b035cb.aspx
0
 
LVL 18

Expert Comment

by:John (Yiannis) Toutountzoglou
ID: 33709245
StreamWriter = New StreamWriter("myfile.txt") 'creates a new text file
StreamWriter = New StreamWriter("C:\append.txt", True) 'append lines of text to a file.
0
 
LVL 18

Expert Comment

by:John (Yiannis) Toutountzoglou
ID: 33709296
Take a look here ...It is Very helpfull..
http://dotnetperls.com/streamwriter-vbnet
0
 
LVL 18

Expert Comment

by:John (Yiannis) Toutountzoglou
ID: 33709325
@lee88 ..if there are several answers with multiple comments related to the question you can accept multiple solutions....
0
 

Author Comment

by:lee88
ID: 33709339
OK. Thanks for the help.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now