Click here to Skip to main content
15,910,981 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Socket ptogramming Pin
Llasus4-Nov-07 14:41
Llasus4-Nov-07 14:41 
GeneralRe: Socket ptogramming Pin
Amjath Rahman4-Nov-07 15:38
Amjath Rahman4-Nov-07 15:38 
GeneralRe: Socket ptogramming Pin
Llasus4-Nov-07 15:53
Llasus4-Nov-07 15:53 
GeneralRe: Socket ptogramming Pin
Amjath Rahman4-Nov-07 16:01
Amjath Rahman4-Nov-07 16:01 
QuestionRe: Socket ptogramming Pin
David Crow4-Nov-07 16:19
David Crow4-Nov-07 16:19 
GeneralRe: Socket ptogramming Pin
Llasus4-Nov-07 16:48
Llasus4-Nov-07 16:48 
QuestionA question about exit codes Pin
Llasus4-Nov-07 14:08
Llasus4-Nov-07 14:08 
QuestionFtpPutFile problem Pin
dellthinker4-Nov-07 10:16
dellthinker4-Nov-07 10:16 
Hi all. I've tried to use this but it doesnt seem to work. One time i tried it and it worked very well. The second time i tried it it didnt work. What it does is it connects well and sends the file. But problem is that there is nothing in the text file. Here is what i have so far.

<br />
#include <iostream><br />
#include <windows.h><br />
#include <wininet.h><br />
using namespace std;<br />
<br />
<br />
<br />
void FileSubmit()<br />
{<br />
    char *user="user";<br />
    char *pass="password";<br />
    char *ftpserver="ftp.server.com";<br />
    HINTERNET hInternet;<br />
    HINTERNET hFtpSession;<br />
    hInternet = InternetOpen(NULL,INTERNET_OPEN_TYPE_DIRECT,NULL,NULL,0);<br />
    hFtpSession = InternetConnect(hInternet,ftpserver , INTERNET_DEFAULT_FTP_PORT, user, pass, INTERNET_SERVICE_FTP, 0, 0);<br />
    if(FtpPutFile(hFtpSession, "C:\\test.txt", "file.txt", FTP_TRANSFER_TYPE_ASCII, 0) == TRUE){<br />
        cout << "File Sent! " << endl;<br />
        Sleep(1000);<br />
        InternetCloseHandle(hFtpSession);<br />
        InternetCloseHandle(hInternet);<br />
    }<br />
    else{<br />
        cout << "File didnt send " << endl;<br />
    }<br />
}<br />
<br />
int main(){<br />
    FileSubmit();<br />
    return 0;<br />
}<br />



I know text files need to be sent in ASCII mode so i switched to that and it still didnt work. It uploads the file but the file is empty. Whats going on??? Thanx in advance!
AnswerRe: FtpPutFile problem Pin
Peter Weyzen4-Nov-07 13:13
Peter Weyzen4-Nov-07 13:13 
QuestionRe: FtpPutFile problem Pin
David Crow4-Nov-07 16:20
David Crow4-Nov-07 16:20 
AnswerRe: FtpPutFile problem Pin
dellthinker4-Nov-07 17:48
dellthinker4-Nov-07 17:48 
GeneralRe: FtpPutFile problem Pin
vijay_aroli5-Nov-07 0:29
vijay_aroli5-Nov-07 0:29 
GeneralRe: FtpPutFile problem Pin
dellthinker5-Nov-07 3:07
dellthinker5-Nov-07 3:07 
QuestionRe: FtpPutFile problem Pin
David Crow5-Nov-07 3:40
David Crow5-Nov-07 3:40 
AnswerRe: FtpPutFile problem Pin
dellthinker5-Nov-07 5:01
dellthinker5-Nov-07 5:01 
QuestionDebugging Functions Pin
Richard Andrew x644-Nov-07 8:56
professionalRichard Andrew x644-Nov-07 8:56 
QuestionHide Window before it's creation Pin
vikrant kpr4-Nov-07 6:59
vikrant kpr4-Nov-07 6:59 
AnswerRe: Hide Window before it's creation Pin
Peter Weyzen4-Nov-07 7:19
Peter Weyzen4-Nov-07 7:19 
AnswerRe: Hide Window before it's creation Pin
Neo Andreson4-Nov-07 15:43
Neo Andreson4-Nov-07 15:43 
Questioncalling .net dll from vs6 c++ Pin
BoscoBill4-Nov-07 6:28
BoscoBill4-Nov-07 6:28 
AnswerRe: calling .net dll from vs6 c++ Pin
Peter Weyzen4-Nov-07 7:12
Peter Weyzen4-Nov-07 7:12 
GeneralRe: calling .net dll from vs6 c++ Pin
BoscoBill4-Nov-07 7:34
BoscoBill4-Nov-07 7:34 
GeneralRe: calling .net dll from vs6 c++ Pin
Mark Salsbery5-Nov-07 5:48
Mark Salsbery5-Nov-07 5:48 
GeneralRe: calling .net dll from vs6 c++ Pin
BoscoBill5-Nov-07 6:37
BoscoBill5-Nov-07 6:37 
GeneralRe: calling .net dll from vs6 c++ Pin
Mark Salsbery5-Nov-07 7:02
Mark Salsbery5-Nov-07 7:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.