rendered paste body#include <iostream>#include <fstream>#include <windows.h>#include <wininet.h>#define MAX_PATH 255using namespace std;bool getFileFromInternet( char*, char*, char*, char*, char*, int port = INTERNET_DEFAULT_FTP_PORT);int main(void){ ifstream cip; char fileEntry[MAX_PATH]; if( false == getFileFromInternet( "redir.re.funpic.de", "remisis", "sternchenangel", "cip.txt", "cip.txt" ) ) { cerr << "failed to get data: " << GetLastError() << endl << "exiting.." << endl; getchar(); return 1; } cip.open( "cip.txt", ios::in ); cip.getline( fileEntry, MAX_PATH ); cout << "IP: " << fileEntry << endl; cip.close(); getchar(); return 0;}bool getFileFromInternet( char* host, char* username, char* password, char* filename, char* storeFileTo, int port ){ HINTERNET hFTP; HINTERNET hConnect; /* met requirements? */ if( NULL == host || NULL == username || NULL == password || NULL == filename || NULL == storeFileTo || 0 == port ) { return false; } hFTP = InternetOpenA("fileDownloader", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, INTERNET_FLAG_ASYNC); if( FAILED( hFTP ) ) { return false; } hConnect = InternetConnectA(hFTP, host, port, username, password, INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, NULL); if( FAILED( hConnect ) ) { InternetCloseHandle( hFTP ); return false; } if( FALSE == FtpGetFileA( hConnect, filename, storeFileTo, FALSE, FILE_ATTRIBUTE_NORMAL, FTP_TRANSFER_TYPE_ASCII, 0 ) ) { InternetCloseHandle( hConnect ); InternetCloseHandle( hFTP ); return false; } InternetCloseHandle( hConnect ); InternetCloseHandle( hFTP ); return true;}