SHARE
TWEET

Untitled

a guest Jun 15th, 2017 89 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <windows.h>
  3. #include <wininet.h>
  4. #pragma comment(lib, "wininet")
  5. using namespace std;
  6.  
  7.  
  8.  
  9. void FileSubmit()
  10. {
  11.     char *user="username";
  12.     char *pass=",./.,./";
  13.     char *ftpserver="ftp.site.com";
  14.     HINTERNET hInternet;
  15.     HINTERNET hFtpSession;
  16.     hInternet = InternetOpen(NULL,INTERNET_OPEN_TYPE_DIRECT,NULL,NULL,0);
  17.     hFtpSession = InternetConnect(hInternet,ftpserver , INTERNET_DEFAULT_FTP_PORT, user, pass, INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0);
  18.     if(FtpPutFile(hFtpSession, "C:\\works.html", "works.html",FTP_TRANSFER_TYPE_BINARY, 0) == TRUE){
  19.         cout << "File Sent! " << endl;
  20.         Sleep(1000);
  21.         InternetCloseHandle(hFtpSession);
  22.         InternetCloseHandle(hInternet);
  23.     }
  24.     else{
  25.         cout << "File didnt send " << endl;
  26.     }
  27. }
  28.  
  29. int main(){
  30.     FileSubmit();
  31.     return 0;
  32. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top