Heuh? On error go to???? That's very old skool style. What about Try Catch?
Secondly, what's wrong with using the static Copy file?
http://msdn.microsoft.com/en-us/libr...file.copy.aspx
File.Copy (oldLocation, newLocation)
And lastly, I'd be pretty confused by a method called MoveFile that would actually copy the file. So, all in all, I would use the following instead:
Dim oldLocation As String = "C:\SomePath\OldFile.txt"
Dim newLocation As String = "C:\SomePath\NewFile.txt"
Try
File.Copy(oldLocation, newLocation)
Catch e As Exception
' Do what you need to do here to deal with the error
End Try
Nothing personal, but I wouldn't qualify the sample code given as a best practice in .NET development.
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of
Beginning ASP.NET 3.5 : in C# and VB,
ASP.NET 2.0 Instant Results and
Dreamweaver MX 2004
Want to be my colleague? Then check out this post.