How to check if file already exists in the folder

I am trying to copy some files to folder. I am using the following statement to check if the source fie exists

 If My.Computer.FileSystem.FileExists(fileToCopy) Then

But I donot know how to check if file exists in the folder before copying. Please advise.

Thanks and best regards, Furqan


Dim SourcePath as string = "c:\SomeFolder\SomeFileYouWantToCopy.txt" 'This is just an example string and could be anything, it maps to fileToCopy in your code.
Dim SaveDirectory as string = "c:\DestinationFolder"

Dim Filename as string = 'get the filename of the original file without the directory on it
Dim SavePath as string =, Filename) 'combines the saveDirectory and the filename to get a fully qualified path.

if then
   'The file exists
    'the file doesn't exist
end if

Need Your Help

Test Explorer not discovering Xunit tests

unit-testing resharper visual-studio-2015 xunit test-explorer

I am currently running VS 2015 Enterprise edition. My global.json file is as follows:

Having issues with making my first webproject with Maven and Eclipse

java eclipse spring maven

I am aving a issues with making my first webproject with Maven and Eclipse...