79620441

Date: 2025-05-13 21:28:43
Score: 1
Natty:
Report link

How about something like so:

Dim path As String = "C:\Users\Desktop\Test.txt"
Dim newEntry As String = Array(0) & Now & Environment.NewLine
Dim oldText As String = ""
If File.Exists(path) Then oldText = File.ReadAllText(path, Encoding.UTF8)
File.WriteAllText(path, newEntry & oldText, Encoding.UTF8)

This way you will have the newest entry at the top of the file.

Reasons:
  • Has code block (-0.5):
  • Starts with a question (0.5): How
  • Low reputation (1):
Posted by: MikeP