Hello all!
I am getting my feet wet at working with ftp. I am working with the WinINet library.
This is what i have so far:
#include "windows.h"
#include <iostream>
#include "wininet.h"
using namespace std;
int main()
{
const char* apphndl = "ftper";
char* wrkingdr;
DWORD buffer[100];
HINTERNET handle,handle2,handle3;
handle = InternetOpen(apphndl,INTERNET_OPEN_TYPE_DIRECT, NULL, NULL,INTERNET_FLAG_ASYNC);
handle = InternetConnect(
handle,
"mysite.com",
INTERNET_DEFAULT_FTP_PORT,
"username",
"password",
INTERNET_SERVICE_FTP,
INTERNET_FLAG_PASSIVE,
*apphndl
);
bool foo = FtpGetCurrentDirectory(handle,wrkingdr,buffer);
cout << "\n\n\n" << foo <<"\n\n\n" << wrkingdr << "\n\n";
FtpPutFile(handle2,"mew.txt","mew.txt",FTP_TRANSFER_TYPE_BINARY,*apphndl);
InternetCloseHandle(handle);
int ggg;
cout << "adsfasdfsdf";
cin >> ggg;
}
This does not give me any compile or link errors. But the problem is that it does not do what it is meant to do. Could any one shed some light on this?
Thanks