FTP上传问题

发布于 2024-12-05 02:16:51 字数 309 浏览 8 评论 0原文

我编写了一个程序,通过 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

怼怹恏 2024-12-12 02:16:51

来自 InternetConnect()< 的文档/代码>

如果连接成功,则返回会话的有效句柄,否则返回NULL。要检索扩展错误信息,请调用 GetLastError ()。应用程序还可以使用 InternetGetLastResponseInfo() 确定访问服务被拒绝的原因。

无论如何,调用都不会返回 false。假设您的意思是它返回NULL,那么您需要调用GetLastError() 和/或 InternetGetLastResponseInfo() 获取信息。您可以在 系统错误代码。如果您在此处发布结果,那么我们也许可以帮助您解决问题。

From the documentation for InternetConnect():

Returns a valid handle to the session if the connection is successful, or NULL otherwise. To retrieve extended error information, call GetLastError(). An application can also use InternetGetLastResponseInfo() to determine why access to the service was denied.

In any case, the call is not returning false. Assuming you meant it returns NULL, then you need to call GetLastError() and/or InternetGetLastResponseInfo() 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.

雨后咖啡店 2024-12-12 02:16:51

首先确保您确实可以使用 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" ???

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文