Tag: P/Invoke

  • How to copy a file and report progress in C# using P/Invoke

    •

    10 minutes

    One of the main missing APIs in the .NET Base Class Library is the ability to report progress while copying a large file. We do have the File.Copy and FileInfo.CopyTo methods but there’s no way to report how much data has been copied. Even worse, these methods are not asynchronous, meaning that the calling thread…