Advertisement
Guest User

Untitled

a guest
Jun 15th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.85 KB | None | 0 0
  1. #include <stream>
  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.         CloseHandle(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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement