0

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

2
Contributors
1
Reply
6
Views
8 Years
Discussion Span
Last Post by nucleon
0

I don't know if this is the problem but check your variables "handle" and "handle2" everywhere you use them. If it still doesn't work, then what exactly do you want it to do and what is it doing?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.