Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 398
  • Last Modified:

StreamWriter question

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
lee88
Asked:
lee88
  • 3
1 Solution
 
joriszwaenepoelCommented:
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
 
John (Yiannis) ToutountzoglouInstructor Multiengine PilotCommented:
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
 
John (Yiannis) ToutountzoglouInstructor Multiengine PilotCommented:
Take a look here ...It is Very helpfull..
http://dotnetperls.com/streamwriter-vbnet
0
 
John (Yiannis) ToutountzoglouInstructor Multiengine PilotCommented:
@lee88 ..if there are several answers with multiple comments related to the question you can accept multiple solutions....
0
 
lee88Author Commented:
OK. Thanks for the help.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now