Socket 连FTP出现550错误

q287551219 2009-07-02 07:09:53
报的是文件不可用,在Windos下没问题
UNIX 下就报了550说文件不可用,是不是我路径配错了?
我是找的一个FTP库,是通过Socket连接的。
我配的获得文件的路径是/aaa
是不是配的有问题?
public virtual void SetCurrentDirectory(String remotePath)
{
LockTcpClient();

ArrayList tempMessageList = new ArrayList();
int returnValue = 0;
tempMessageList = SendCommand("CWD " + remotePath);
returnValue = GetMessageReturnValue((string)tempMessageList[0]);
if(returnValue != 250)
{
throw new Exception((string)tempMessageList[0]);
}

UnlockTcpClient();
}
public ArrayList SendCommand(String command)
{
NetworkStream stream = this.tcpClient.GetStream();
this.activeConnectionsCount++;

Byte[] cmdBytes = Encoding.ASCII.GetBytes((command+"\r\n").ToCharArray());
stream.Write(cmdBytes, 0, cmdBytes.Length);

this.activeConnectionsCount--;

return Read();
}
我需要怎么改?新手求助!
...全文
143 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
q287551219 2009-07-03
  • 打赏
  • 举报
回复
困扰我2天啦!牛人来啊
q287551219 2009-07-02
  • 打赏
  • 举报
回复
牛人帮忙啊!

110,499

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧