Hi all!
i am trying to copy a file from 1 location to other location with a new name. The new name should be like "Oldname + date & time". I wrote the following code but getting error that the Given path format is not supported
Imports System.IO
Public Class Form1
Dim file_name As String = "jpeg.rtf"
Dim Now As DateTime = Date.Now
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim path1 As String = Trim("D:\frs\files\" & file_name)
Dim path2 As String = Trim("D:\frs\versions\" & file_name & "\" & Now & file_name)
File.Copy(path1, path2)
MsgBox("D:\frs\versions\" & file_name & "\" & Now & file_name)
End Sub
End Class