Solved

StreamWriter question

Posted on 2010-09-18
5
381 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

726 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