GetFTPConnectionByIndex

 

#include “BlackIceDEVMODE.h”

 

DWORD        GetFTPConnectionByIndex (BlackIceDEVMODE* pDevMode, int iIndex);

Description

Returns the ID of a stored FTP connection. Used with GetFTPConnectionCount to enumerate the stored FTP server connection settings. See the code example below.

Parameters

BlackIceDEVMODE* pDevMode - pointer to the BlackIceDEVMODE structure.

Int iIndex                                           - index of the connection to return.

Return value

The function returns the ID of the stored connection settings. This ID can be used in other GetFTP* and SetFTP* functions to retrieve or change the settings.

Programming Notes

None

Code Example

Enumerating the stored connection settings:

int iCount = GetFTPConnectionCount(pDevMode);

for (int i = 0; i < iCount; i++)
{
      DWORD dwConnectionID = GetFTPConnectionByIndex(pDevMode, i);

      TCHAR szName[128] = {0};
      DWORD dwSize = sizeof(szName);
      GetFTPConnectionName(pDevMode, dwConnectionID, szName, &dwSize);
      _tprintf(_T("%s\n"), szName);
}