how to write datetime.now every time in a newline in a notepad ?

คำตอบ how to write datetime.now every time in a newline in a notepad ?

  • 22 สิงหาคม 2555 12:43
     
     

    hi all

    iam using this code to write time to notepad

    My.Computer.FileSystem.WriteAllText("c:\max.txt", DateTime.Now, True)

    but it put it all in one line

    so  how to write datetime.now each time in a newline in a notepad ???

    thanks advace


    • แก้ไขโดย omanxp45-2 22 สิงหาคม 2555 13:02
    •  

ตอบทั้งหมด

  • 22 สิงหาคม 2555 13:20
     
     คำตอบ

    That's because that's what you told it to do. Try it this way instead:

    My.Computer.FileSystem.WriteAllText("c:\max.txt", DateTime.Now.ToLongDateString & vbCrLf, True)

    You could also write the time in but you didn't ask about that.


    Please call me Frank :)

    • ทำเครื่องหมายเป็นคำตอบโดย omanxp45-2 22 สิงหาคม 2555 14:01
    •  
  • 22 สิงหาคม 2555 14:01
     
     

    That's because that's what you told it to do. Try it this way instead:

    My.Computer.FileSystem.WriteAllText("c:\max.txt", DateTime.Now.ToLongDateString & vbCrLf, True)

    You could also write the time in but you didn't ask about that.


    Please call me Frank :)

    works

    thanks

  • 22 สิงหาคม 2555 14:03
     
     
    works

    thanks


    :)

    Please call me Frank :)

Unable to Service Request

Unable to Service Request

For the latest headlines and to see what's new, visit the MSDN home page.

Check out the various MSDN Developer Centers where you can find the latest product information, technical resources, and community offerings.

Visit the MSDN Library for the latest technical articles, reference documentation, downloads, and more.
© 2013 Microsoft. All rights reserved.