Показать сообщение отдельно
Старый 11.12.2013, 13:22   #7  
DreamCreator is offline
DreamCreator
Moderator
Аватар для DreamCreator
Axapta Retail User
 
553 / 45 (3) +++
Регистрация: 04.11.2004
Адрес: Казань
Добрый день!
Не подскажите, как можно перебрать файлы на ftp? Axapta 3.0 SP3

X++:
static void testConnect2FTP(Args _args)
{
    str             ftp='our-ftp.local';
    str             username='admin';
    str             pass='123';

    WinInetClient   winInet = new WinInetClient();
    int             code1;
    int             code2;

    Filename        fileNamePng;
    int             handlePng = 0;

    FileFolder_RU   fileFolder = @"ftp://our-ftp.local/Pictures/images/catalog/products/angle/";
    ;

    code1 = winInet.internetConnect(ftp, username, pass);

    if (!code1)
        throw error("Не удалось подключиться к ftp-серверу!");

    code2 = winInet.ftpSetCurrentDirectory(code1, "/Pictures/images/catalog/products/angle/");

    // А дальше как?

    // Попытка перебрать файлы, как в обычной папке - handlePng всегда -1, т.е. findFirstFile файлов не видит, хотя в проводнике по этому пути они отображаются
    [handlePng, fileNamePng] = WinApi::findFirstFile(fileFolder + "*.*");

    if (handlePng != -1)
    {
        while (fileNamePng)
        {
            info(fileNamePng);
            fileNamePng = WinApi::findNextFile(handlePng);
        }
    }

    WinApi::findClose(handlePng);
}

Последний раз редактировалось DreamCreator; 11.12.2013 в 13:24.