SmartFTP FTP Library
ISFTPItems Interface

This interface is implemented by the SFTPItems class.

ISFTPItems
IDL
interface ISFTPItems : IDispatch;

VBScript

Dim objSFTP
Set objSFTP = CreateObject("sfFTPLib.SFTPConnection")
...
objSFTP.ReadDirectory(".")
Dim objItems
Set objItems = objSFTP.Items
Dim objItem
For Each objItem In objItems
  WScript.Echo("Type=" & objItem.Type & ", Name=" & objItem.Name & ", Size=" & objItem.SizeLo & ", Date=" & CDate(objItem.ModifyTimeAsDate))
Next

 

JavaScript

var objSFTP = new ActiveXObject("sfFTPLib.SFTPConnection");
objSFTP.ReadDirectory(".");
var objItems = objSFTP.Items;
for (var fc = new Enumerator(objItems); !fc.atEnd(); fc.moveNext())
{
  var objItem = fc.item();
  WScript.Echo("Type=" + objItem.Type + ", Name=" + objItem.Name + ", Size=" + objItem.SizeLo + ", Date=" + objItem.Date);
}

 

C#

if(sftp.ReadDirectory(".") == sfFTPLib.enumError.ftpErrorSuccess)
{
  CSFTPItems items = sftp.Items;
  // Use the foreach statement to iterate through elements in the collection
  foreach(CSFTPItem objItem in items)
  {
    System.Console.WriteLine("Type={0}; Name={1}; Size={2}", objItem.Type, objItem.Name, objItem.Size);
  }
}
ISFTPItems Methods 
Description 
Adds an item to the end of the collection. 
Adds another collection of items to the end of the collection. 
Find 
Searches the collection for an item by name. (case sensitive) 
Searches the collection for an item by name. (case insensitive) 
Item 
References item at the specified index. 
ISFTPItems Properties 
Description 
Creates an enumerator object for the collection. 
Contains the number of items in the collection. 
This is NewEnum, a member of class ISFTPItems. 
This is NewReverseEnum, a member of class ISFTPItems. 
What do you think about this topic? Send feedback!
Copyright (c) by SmartSoft Ltd. All rights reserved.