Returns the time difference between the client and server.
public TimeSpan GetServerTimeDifference()
Public Function GetServerTimeDifference As TimeSpan
public:
TimeSpan GetServerTimeDifference();
Return Value
The time difference between the client and server.
Shows how to use GetServerTimeDifference method to get time difference between the client and the server.
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();
Imports ComponentPro.Net
...
' Create a new class instance.
Dim client As 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.
Dim ts As TimeSpan = client.GetServerTimeDifference()
Console.WriteLine("Time difference: " & ts.ToString())
' ...
' Disconnect.
client.Disconnect()