0

How do I make sure that the downloaded file myfileLocal.wav matches myfileInServer.wav?

using System.Net;

WebClient webClient = new WebClient();
webClient.DownloadFile("http://example.net/myfileInServer.wav", @"c:\myfileLocal.wav");

Would it be a checksum, or bytesize? Just want to make sure it in fact is a wav file, and the correct one.

Edited for clarification: This program will not run on my machine, but rather on clients. I need to make sure that the downloaded file matches what the program requires.

I have the file locally, and what I really want to find out is if the file in their machine matches the one that I have, in other words the intended file. The one in the server might change.

lakersfan
  • 71
  • 5
  • If you already have access to a copy of the file, why are you downloading another copy? Typically the server would post the MD5 hash of the file and after you download it you could perform your own MD5 hash and see if it matches what was posted on the server. – itsme86 May 14 '20 at 17:27
  • Does this answer your question? [C# file management](https://stackoverflow.com/questions/211008/c-sharp-file-management) – Retired Ninja May 14 '20 at 17:31
  • This may also help: https://stackoverflow.com/questions/1358510/how-to-compare-2-files-fast-using-net – Retired Ninja May 14 '20 at 17:31
  • itsme86 it is for clients to download. retired ninja i've modified my post to reflect what im really asking :) – lakersfan May 14 '20 at 17:42

0 Answers0