c#ftp客户端 支持主动和被动模式,c#ftp客户端 主动模式 被动模 PORT PASV
调用示例如下: OpenFTP.FTP f = new OpenFTP.FTP(); f.Connect("127.0.0.1", "username_here", "password_here"); f.ChangeDirectory("somedirectory"); f.Files.Upload(Path.GetFileName(sFileName), Path.GetFileName(sFileName)); while (!f.Files.UploadComplete) { Console.WriteLine("Uploading: TotalBytes: " f.Files.TotalBytes.ToString() ", : PercentComplete: " f.Files.PercentComplete.ToString()); } Console.WriteLine("Upload Complete: TotalBytes: " f.Files.TotalBytes.ToString() ", : PercentComplete: " f.Files.PercentComplete.ToString()); f.Disconnect(); f = null;
评论