ComponentPro UltimateFtp

      Determine local PC and server time difference

      Language Filter: AllSend comments on this topic to ComponentPro

      To determine the time difference between the client and the SFTP server, call the GetServerTimeDifference method. We will take advantage of this method with the following example:

      using System;
      using ComponentPro.Net;
      
      ...
      
      // Create a new class instance.
      Ftp client = new Ftp();
      
      // Connect to the FTP server.
      client.Connect("myserver");
      
      // Authenticate.
      client.Authenticate("userName", "password");
      
      // ... 
       
      // Get the time difference between the server and the client.
      TimeSpan ts = client.GetServerTimeDifference();
      
      Console.WriteLine("Time difference: " + ts.ToString());
      
      // ... 
       
      // Disconnect.
      client.Disconnect();