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工作如此?如果是的话添加标志修复问题? –
是的,它确实:)再次感谢 –