FTP上传问题
我编写了一个程序,通过 FTP 协议上传到我的 NAS。 当我尝试上传到我的网页时,我的程序运行正常,但当我输入 NAS 的 IP 时,以下行返回 false:
HINTERNET MyhFtpSession = InternetConnect(MyhInternet, "ftp://89.xxx.xxx.xxx/media", INTERNET_DEFAULT_FTP_PORT, "MyUsername", "MyPassword", INTERNET_SERVICE_FTP, 0, 0);
有什么问题吗? 是不是IP线路错误?
I have made a program to upload to my NAS via FTP protocol.
My program runs fine when I try to upload to my web page, but when I enter the IP of my NAS, the following line returns false:
HINTERNET MyhFtpSession = InternetConnect(MyhInternet, "ftp://89.xxx.xxx.xxx/media", INTERNET_DEFAULT_FTP_PORT, "MyUsername", "MyPassword", INTERNET_SERVICE_FTP, 0, 0);
What is the problem?
Is the IP line wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
来自
InternetConnect()< 的文档/代码>
:
无论如何,调用都不会返回
false
。假设您的意思是它返回NULL
,那么您需要调用GetLastError()
和/或InternetGetLastResponseInfo()
获取信息。您可以在 系统错误代码。如果您在此处发布结果,那么我们也许可以帮助您解决问题。From the documentation for
InternetConnect()
:In any case, the call is not returning
false
. Assuming you meant it returnsNULL
, then you need to callGetLastError()
and/orInternetGetLastResponseInfo()
to get the information. You can search for the meaning of the error code in the documentation on system error codes. If you post the result here, then we might be able to help you fix your problem.首先确保您确实可以使用 FileZilla 或其他东西连接到该站点。
另外,如果您只输入不带前导“ftp”//”和尾随“/media”的 IP 地址,会发生什么情况???
First make sure you can actually connect to the site with FileZilla or something.
Also, what happens if you just put the IP address without the leading "ftp"//" and the trailing "/media" ???