我能够在主动传输模式下使用filezilla连接到该服务器。我也在代码中设置了相同的内容,但无法上传文件。
请找到下面的代码。
//将处理程序注册到CommandResponse事件。 myclient.CommandResponse + = client_CommandResponse;
// Connect to the server.
myclient.Passive = false;
myclient.Connect(host, port);
myclient.KeepAliveDuringTransferInterval = 5000;
myclient.Timeout = 200000;
// Authenticate.
myclient.Authenticate(username, password);
// Upload the file.
myclient.UploadFile(serverFilePath, ComponentPro.IO.FileSystemPath.Combine(rootfolder, fileUpload.FileName));
// Disconnect when finish.
myclient.Disconnect();
lblResult.Text = _sb.ToString();
感谢您的帮助。