Solved

appendtext

Posted on 2007-04-05
2
218 Views
Last Modified: 2010-04-23
Why can't i use Vbcrlf here? I want it to stamp time on the same file the next line.


            Dim sw As StreamWriter = File.AppendText("mypath")



            Try

                mypath.Write(DateTime.Now.ToString("MMMM, dd, yyyy hh:mm:ss"))  & vbcrlf   <------------- error


            Catch ex As Exception


                MessageBox.Show(ex.Message)

            Finally

                mypath.Close()

            End Try
0
Comment
Question by:VBdotnet2005
2 Comments
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 125 total points
ID: 18860780
Put the vbCrLf INSIDE the parenthesis of the StreamWriter.Write() call:

    mypath.Write(DateTime.Now.ToString("MMMM, dd, yyyy hh:mm:ss")  & vbCrLf)
0
 

Author Comment

by:VBdotnet2005
ID: 18860823
Idle_Mind,
Thank you
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

697 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