123456789101112131415161718192021222324252627282930313233 |
- using System;
- using System.Net;
- using System.Net.FtpClient;
- using System.Net.FtpClient.Extensions;
- namespace Examples {
- public static class GetChecksumExample {
- public static void GetChceksumExample() {
- FtpHash hash = null;
- using (FtpClient cl = new FtpClient()) {
- cl.Credentials = new NetworkCredential("user", "pass");
- cl.Host = "some.ftpserver.on.the.internet.com";
- hash = cl.GetChecksum("/path/to/remote/file");
-
-
-
-
-
-
-
-
-
- if (hash.IsValid && hash.Algorithm != FtpHashAlgorithm.CRC) {
- if (hash.Verify("/some/local/file")) {
- Console.WriteLine("The checksum's match!");
- }
- }
- }
- }
- }
- }
|