0
大家好,晚上好,錯誤12003 FTP文件上傳錯誤
這是以FTP爲中心文件上傳使用C++。我一直在試圖上傳一個FTP文件,我得到錯誤12003一直在網上搜索,我沒有看到任何有用的..似乎令人討厭。
我的代碼看起來像這樣
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <wininet.h>
#pragma comment (lib, "wininet.lib")
int main()
{
HINTERNET hInternet;
HINTERNET hFtpSession;
hInternet = InternetOpen(NULL, INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);
if(!hInternet)
{
printf("Error : %d\n",GetLastError());
}
hFtpSession = InternetConnect(hInternet, "myohyip8.5gbfree.com", INTERNET_DEFAULT_FTP_PORT, "myohyip8", "WxqHjNGv", INTERNET_SERVICE_FTP, 0, 0);
if(!hFtpSession)
{
printf("Error : %d\n",GetLastError());
}
if (!FtpPutFile(hFtpSession, "C:\\ivan.txt", "myivan.txt", FTP_TRANSFER_TYPE_BINARY, 0))
{
printf("Error : %d\n", GetLastError());
}
else{
printf("File Upload Successful :)\n");
}
InternetCloseHandle(hFtpSession);
InternetCloseHandle(hInternet);
system("PAUSE");
return 0;
}
這已經讓我擔心,我沒有在什麼地方,從這裏走一個想法,在我看來,像一個文件系統錯誤。
是它在被動模式。從我在CoreFTP –
這裏看到的coreFTP工作如此?如果是的話添加標誌修復問題? –
是的,它確實:)再次感謝 –