Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stream>
- #include <windows.h>
- #include <wininet.h>
- #pragma comment(lib, "wininet")
- using namespace std;
- void FileSubmit()
- {
- char *user="username";
- char *pass=",./.,./";
- char *ftpserver="ftp.site.com";
- HINTERNET hInternet;
- HINTERNET hFtpSession;
- hInternet = InternetOpen(NULL,INTERNET_OPEN_TYPE_DIRECT,NULL,NULL,0);
- hFtpSession = InternetConnect(hInternet,ftpserver , INTERNET_DEFAULT_FTP_PORT, user, pass, INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0);
- if(FtpPutFile(hFtpSession, "C:\\works.html", "works.html",FTP_TRANSFER_TYPE_BINARY, 0) == TRUE){
- cout << "File Sent! " << endl;
- Sleep(1000);
- CloseHandle(hFtpSession);
- InternetCloseHandle(hInternet);
- }
- else{
- cout << "File didnt send " << endl;
- }
- }
- int main(){
- FileSubmit();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement