public class SftpFileInfo : FileInfoBase
Shows how to use GetItemInfo method to retrieve information of a file on an SFTP server.
using System; using ComponentPro.Net; ... // Create a new class instance. Sftp client = new Sftp(); // Connect to the SFTP server. client.Connect("localhost"); // Authenticate. client.Authenticate("test", "test"); // ... // Get information of remote file '/test.dat'. SftpFileInfo info = (SftpFileInfo)client.GetItemInfo("/test.dat"); Console.WriteLine("Name: {0}, FullName: {1}, Permissions: {2}", info.Name, info.FullName, info.Permissions); // ... // Disconnect. client.Disconnect();