Can someone tell me some functions that search a directory on ftp or a website that explains how to do this. I can scan the harddrive with FindFirstFile, FindNextFile, but I need to know how to do it on ftp.
Thanks
Can someone tell me some functions that search a directory on ftp or a website that explains how to do this. I can scan the harddrive with FindFirstFile, FindNextFile, but I need to know how to do it on ftp.
Thanks
The API has functions prefixed with 'ftp' that may be of some interest to you, eg. FtpFindFirstFile.
thanks Ken Fitlike,
I tried to write a program to scan a ftp and it works, but it only displays the first file. Could you help me figure out whats wrong with this code?
Code:#include <windows.h> #include <Wininet.h> #include <iostream.h> int main() { WIN32_FIND_DATA pDirInfo; HINTERNET hDir; HINTERNET intOpen; HINTERNET hConnect; char userName[100]=""; char password[100]=""; char server[100]=""; cout << "Enter the server: "; cin >> server; cout << "Enter your user name: "; cin >> userName; cout << "Enter your password: "; cin >> password; intOpen = InternetOpen("Microsoft Internet Explorer", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL,INTERNET_FLAG_ASYNC); hConnect = InternetConnect(intOpen, server, INTERNET_DEFAULT_FTP_PORT, userName, password, INTERNET_SERVICE_FTP, INTERNET_SERVICE_FTP, 0); hDir = FtpFindFirstFile(hConnect, "*.*", &pDirInfo, INTERNET_FLAG_DONT_CACHE, 0); cout << "\nRoot Dir Contains:\n" << pDirInfo.cFileName << "\n"; while(InternetFindNextFile (hDir, &pDirInfo)) cout << pDirInfo.cFileName << "\n"; return 0; }
HEEEEEEEEEEEEEELLLPPPPPPPPPPPPP MEEEEEEEEEEEEEEEEEEEEE!
... please.
You're definitely gonna get told by the mods for that one!Originally posted by pinkcheese
HEEEEEEEEEEEEEELLLPPPPPPPPPPPPP MEEEEEEEEEEEEEEEEEEEEE!
... please.
Exactly..... no bumping threads.... (and no grovelling, either )
When all else fails, read the instructions.
If you're posting code, use code tags: [code] /* insert code here */ [/code]
FtpFindFirstFile/FtpFindNextFile
Makes sense, huh? Look them both up on MSDN. (msdn.microsoft.com)
There is no FtpFindNextFile, its InternetFindNextFile.