Re: SFTP AttributesDataDelegate Not Executing - WeOnlyDo Discussion board

Re: SFTP AttributesDataDelegate Not Executing (General questions)

by woddrazen, Thursday, December 27, 2012, 10:48 (4349 days ago) @ Harewood

Hi,


Here is simple example that will show you how to use GetAttributes Method inside wodSFTP.NET.
[code]WeOnlyDo.Client.SFTP sftp1;
private void Form1_Load(object sender, EventArgs e)
{
sftp1 = new WeOnlyDo.Client.SFTP();
sftp1.AttributesEvent += new WeOnlyDo.Client.SFTP.AttributesDelegate(sftp1_AttributesEvent);
sftp1.ConnectedEvent += new WeOnlyDo.Client.SFTP.ConnectedDelegate(sftp1_ConnectedEvent);

sftp1.Hostname = your_hostname ;
sftp1.Login = your_login ;
sftp1.Password = your_password ;
sftp1.Connect();
}

void sftp1_ConnectedEvent(object Sender, WeOnlyDo.Client.SFTP.ConnectedArgs Args)
{
if (Args.Error == null)
{
sftp1.GetAttributes( /home/somepath/somefile.rar );
}
else
Console.WriteLine( Error: + Args.Error.Message);
}

void sftp1_AttributesEvent(object Sender, WeOnlyDo.Client.SFTP.AttributesArgs Args)
{
Console.WriteLine(Args.ModificationTime.ToString());
}[/code]
Drazen


Complete thread: