C# FTP Library

码农软件 · 软件分类 · 网络工具包 · 2019-02-27 22:14:26

软件介绍

这个库基于C#和.Net框架,它很好的包装了WININET.DLL的FTP功能,建立了一种有效的与FTP服务器交互的方式

示例代码:

using (FtpConnection ftp = new FtpConnection("ftpserver", "username", "password"))
{
	
	ftp.Open(); /* Open the FTP connection */
	ftp.Login(); /* Login using previously provided credentials */

	if (ftp.DirectoryExists("/incoming")) /* check that a directory exists */
		ftp.SetCurrentDirectory("/incoming"); /* change current directory */

	if (ftp.FileExists("/incoming/file.txt"))  /* check that a file exists */
		ftp.GetFile("/incoming/file.txt", false); /* download /incoming/file.txt as file.txt to current executing directory, overwrite if it exists */

	//do some processing

	try
	{
		ftp.SetCurrentDirectory("/outgoing");
		ftp.PutFile(@"c:\localfile.txt", "file.txt"); /* upload c:\localfile.txt to the current ftp directory as file.txt */
	}
	catch (FtpException e)
	{
		Console.WriteLine(String.Format("FTP Error: {0} {1}", e.ErrorCode, e.Message));
	}

	foreach(var dir in ftp.GetDirectories("/incoming/processed"))
	{
		Console.WriteLine(dir.Name);
		Console.WriteLine(dir.CreationTime);
		foreach (var file in dir.GetFiles())
		{
			Console.WriteLine(file.Name);
			Console.WriteLine(file.LastAccessTime);
		}
	}
}

本文地址:https://codercto.com/soft/d/281.html

Python高性能(第2版)

Python高性能(第2版)

[加] 加布丽埃勒•拉纳诺(Gabriele Lanaro) / 袁国忠 / 人民邮电出版社 / 2018-8 / 59.00元

本书是一本Python性能提升指南,展示了如何利用Python的原生库以及丰富的第三方库来构建健壮的应用程序。书中阐释了如何利用各种剖析器来找出Python应用程序的性能瓶颈,并应用正确的算法和高效的数据结构来解决它们;介绍了如何有效地利用NumPy、Pandas和Cython高性能地执行数值计算;解释了异步编程的相关概念,以及如何利用响应式编程实现响应式应用程序;概述了并行编程的概念,并论述了如......一起来看看 《Python高性能(第2版)》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

html转js在线工具
html转js在线工具

html转js在线工具