Doing some Q&D testing...if I copy a file using My.Computer.FileSystem.CopyFile and compare it to copying the same file using a combination of My.Computer.FileSystem.ReadAllBytes and My.Computer.FileSystem.WriteAllBytes, the Read/WriteAllBytes method is significantly faster (more than twice as fast).
Can I assume this is because the .CopyFile does some kind of file integrity checking or something? The speed is quite useful to me, and unless someone can give me a reason NOT to use the Read/WriteAllBytes method..I'm going to use it instead of .CopyFile
My testing:
VS.
Thanks for any response.
Can I assume this is because the .CopyFile does some kind of file integrity checking or something? The speed is quite useful to me, and unless someone can give me a reason NOT to use the Read/WriteAllBytes method..I'm going to use it instead of .CopyFile
My testing:
Code:
My.Computer.FileSystem.CopyFile(sourcefile, destfile, True)
Code:
temp = My.Computer.FileSystem.ReadAllBytes(sourcefile)
My.Computer.FileSystem.WriteAllBytes(destfile, temp, False)
Thanks for any response.