FTP - 无法使用MS示例上传文件 [英] FTP - can't upload a file using the MS Example

查看:65
本文介绍了FTP - 无法使用MS示例上传文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用微软自己的VB.NET FTP示例:

http://support.microsoft.com/default...b;en-us;832679


我可以得到程序来创建目录,更改目录等,

但是我无法将它上传到FTP服务器。我只是得到了一个

无法连接到远程服务器这之后出错:


s =新套接字(AddressFamily.InterNetwork,SocketType.Stream,

ProtocolType.Tcp)

ep =新的IPEndPoint(Dns.Resolve(ipAddress).AddressList(0),

port)


尝试

s.Connect (ep)

Catch ex As Exception

MessageString = m_sReply

抛出新IOException(无法连接到远程服务器。)


正如我所说,它会做一个目录列表,创建,更改和删除

目录,但它不会传输文件,而且这就是我需要的东西。

它要做。我已经为VS 2003正确设置了代码,根据端口计算的

注释,甚至尝试了VS 2002方式

只是为了确保没有;问题。


我也尝试了Indy FTP客户端,但它甚至没有做一个目录

列表(说机器主动拒绝连接)。


如果有人可以提供帮助我会很感激。

(请通过新闻组发送所有回复)


昏暗的灯光&拯救星球:
http://www.darksky.org/

I''m using Microsoft''s own VB.NET FTP Example:

http://support.microsoft.com/default...b;en-us;832679

I can get the program to create directories, change directories, etc.,
but I can''t get it to upload a file to the FTP server. I just get a
"Cannot connect to remote server" error after this TRY:

s = New Socket(AddressFamily.InterNetwork, SocketType.Stream,
ProtocolType.Tcp)
ep = New IPEndPoint(Dns.Resolve(ipAddress).AddressList(0),
port)

Try
s.Connect(ep)
Catch ex As Exception
MessageString = m_sReply
Throw New IOException("Cannot connect to remote server.")

As I said, it''ll do a directory list, create, change, and delete
directories, but it will NOT transfer a file, and that''s what I need
it to do. I have the code set up properly for VS 2003, per the
comments for the port calculations, and even tried it the VS 2002 way
just to be sure that wasn;t the problem.

I''ve also tried the Indy FTP client, but it won''t even do a directory
list (says the machine "actively refused" the connection).

If someone could help I''d appreciate it.
(please send all replies via the newsgroup)

Dim the Lights & Save the Stars:
http://www.darksky.org/

推荐答案

你好Jen,


这显然似乎是连接问题。

尝试在不使用某些FTP资源管理器的情况下使用命令提示符访问FTP。


如果不起作用则问题在于连接(防火墙或

某事)而不是代码问题。


HTH

rawCoder


Jen <无*********** @ gte.net>在留言中写道

新闻:n3 ******************************** @ 4ax.com ...
Hi Jen,

This apparently seems to be the connectivity issue.
Try to access the FTP using command prompt without using some FTP explorer.

If that doesnt work then the issue is with the connectivity (firewall or
something ) rather than code problem.

HTH
rawCoder

"Jen" <no***********@gte.net> wrote in message
news:n3********************************@4ax.com...
我正在使用微软自己的VB.NET FTP示例:

http://support.microsoft.com/default...b;en-us;832679

我可以让程序创建目录,更改目录等,但是我无法将文件上传到FTP服务器。我只是得到一个
无法连接到远程服务器此尝试后出错:

s =新套接字(AddressFamily.InterNetwork,SocketType.Stream,
ProtocolType.Tcp)
ep =新IPEndPoint(Dns.Resolve(ipAddress)。地址列表(0),
端口)

尝试
s.Connect(ep)
Catch ex As Exception
MessageString = m_sReply
投掷新的IOException(无法连接到远程服务器。)

正如我所说,它会做一个目录列表,创建,更改和删除目录,但它会不转移文件,这就是我需要它做的事情。根据端口计算的
评论,我已经为VS 2003正确设置了代码,甚至尝试了VS 2002方式
只是为了确保不是问题。

我也尝试了Indy FTP客户端,但它甚至没有做目录
列表(说机器主动拒绝连接)。
如果有人可以提供帮助,我会很感激。

(请通过新闻组发送所有回复)

Dim the Lights&拯救星球:
http://www.darksky.org/
I''m using Microsoft''s own VB.NET FTP Example:

http://support.microsoft.com/default...b;en-us;832679

I can get the program to create directories, change directories, etc.,
but I can''t get it to upload a file to the FTP server. I just get a
"Cannot connect to remote server" error after this TRY:

s = New Socket(AddressFamily.InterNetwork, SocketType.Stream,
ProtocolType.Tcp)
ep = New IPEndPoint(Dns.Resolve(ipAddress).AddressList(0),
port)

Try
s.Connect(ep)
Catch ex As Exception
MessageString = m_sReply
Throw New IOException("Cannot connect to remote server.")

As I said, it''ll do a directory list, create, change, and delete
directories, but it will NOT transfer a file, and that''s what I need
it to do. I have the code set up properly for VS 2003, per the
comments for the port calculations, and even tried it the VS 2002 way
just to be sure that wasn;t the problem.

I''ve also tried the Indy FTP client, but it won''t even do a directory
list (says the machine "actively refused" the connection).

If someone could help I''d appreciate it.
(please send all replies via the newsgroup)

Dim the Lights & Save the Stars:
http://www.darksky.org/



我可以使用WS_FTP上传/下载文件,所以我不认为这是
连接问题。
I can use WS_FTP to upload/download files, so I don''t think it''s a
connectivity issue.
" rawCoder" < RA ****** @ hotmail.com>写道:
嗨仁,

这显然似乎是连接问题。
尝试使用命令提示符访问FTP而不使用某些FTP资源管理器。
某些东西)而不是代码问题。

HTH
rawCoder
"rawCoder" <ra******@hotmail.com> wrote: Hi Jen,

This apparently seems to be the connectivity issue.
Try to access the FTP using command prompt without using some FTP explorer.

If that doesnt work then the issue is with the connectivity (firewall or
something ) rather than code problem.

HTH
rawCoder



(请通过新闻组发送所有回复)


Dim the Lights&拯救星球:
http://www.darksky.org/





它试图上传的文件不存在于我的机器上。我有

来创建它们。你是想要上传的文件吗?




------------------ -

Jen <无*********** @ gte.net>在留言中写道

新闻:n3 ******************************** @ 4ax.com ...

我正在使用微软自己的VB.NET FTP示例:

http://support.microsoft.com/default...b;en-us;832679


我可以获得程序来创建目录,更改目录等等,

但我无法将其上传到FTP服务器。我只是得到了一个

无法连接到远程服务器这之后出错:


s =新套接字(AddressFamily.InterNetwork,SocketType.Stream,

ProtocolType.Tcp)

ep =新的IPEndPoint(Dns.Resolve(ipAddress).AddressList(0),

port)


尝试

s.Connect (ep)

Catch ex As Exception

MessageString = m_sReply

抛出新IOException(无法连接到远程服务器。)


正如我所说,它会做一个目录列表,创建,更改和删除

目录,但它不会传输文件,而且这就是我需要的东西。

它要做。我已经为VS 2003正确设置了代码,根据端口计算的

注释,甚至尝试了VS 2002方式

只是为了确保没有;问题。


我也尝试了Indy FTP客户端,但它甚至没有做一个目录

列表(说机器主动拒绝连接)。


如果有人可以提供帮助我会很感激。

(请通过新闻组发送所有回复)


昏暗的灯光&拯救星球:
http://www.darksky.org/


这篇关于FTP - 无法使用MS示例上传文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆