Solved

appendtext

Posted on 2007-04-05
2
192 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 85

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

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

920 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

15 Experts available now in Live!

Get 1:1 Help Now