FTP 使用 .NET 上传多个文件而无需断开连接

2

本文介绍了FTP 使用 .NET 上传多个文件而无需断开连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我正在使用 FtpWebRequest 上传多个文件.
但是对于我打开和关闭连接的每个文件.

I'm uploading multiple files using FtpWebRequest.
But for every file I'm opening and closing a connection.

如何使用同一连接上传多个文件?

How can I upload multiple files using the same connection?

像一个 ftp 客户端应用程序,使用用户名和密码连接,更改目录,上传文件 1,上传文件 2,上传文件 3,断开连接.

Like a ftp client application, connect using username and password, change directory, upload file1, upload file2, upload file3, disconnect.

推荐答案

FtpWebRequest.KeepAlive的默认值为true.您是否明确将 KeepAlive 设置为 false?

The default value of FtpWebRequest.KeepAlive is true. Are you explicitly setting KeepAlive to false?

这篇关于FTP 使用 .NET 上传多个文件而无需断开连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

C# 中的多播委托奇怪行为?
Multicast delegate weird behavior in C#?(C# 中的多播委托奇怪行为?)...
2023-11-11 C#/.NET开发问题
6

如何将代表存储在列表中
How to store delegates in a List(如何将代表存储在列表中)...
2023-11-11 C#/.NET开发问题
6

代表如何工作(在后台)?
How delegates work (in the background)?(代表如何工作(在后台)?)...
2023-11-11 C#/.NET开发问题
5

Delegate.CreateDelegate() 和泛型:错误绑定到目标方法
Delegate.CreateDelegate() and generics: Error binding to target method(Delegate.CreateDelegate() 和泛型:错误绑定到目标方法)...
2023-11-11 C#/.NET开发问题
14

函数委托与函数
Func Delegate vs Function(函数委托与函数)...
2023-11-11 C#/.NET开发问题
6

具有未知类型的 CreateDelegate
CreateDelegate with unknown types(具有未知类型的 CreateDelegate)...
2023-11-11 C#/.NET开发问题
5