C# Class HYPDM.WinUI.Util.FTPHelper

FTP帮助类
Mostra file Open project: huayancreate/HYPDM Class Usage Examples

Public Methods

Method Description
Delete ( string fileName ) : void

删除文件

Download ( string filePath, string fileName ) : void

下载

DownloadFile ( string filePath, string fileName, string &info ) : bool
FTPHelper ( string FtpServerIP, string FtpRemotePath, string FtpUserID, string FtpPassword ) : System

连接FTP服务器

FileExist ( string RemoteFileName ) : bool

判断当前目录下指定的文件是否存在

GetFileList ( string url ) : string[]

获取当前目录下文件列表(不包括文件夹)

GetFileSize ( string filename ) : long

获取指定文件大小

GetFilesDetailList ( ) : string[]

获取当前目录下明细(包含文件和文件夹)

GotoDirectory ( string DirectoryName, bool IsRoot ) : void

切换当前目录

MakeDir ( string dirName ) : void

创建文件夹

MovieFile ( string currentFilename, string newDirectory ) : void

移动文件

ReName ( string currentFilename, string newFilename ) : void

更改文件名

Upload ( string filename ) : void

上传

UploadFile ( string filename, string &info ) : bool

Private Methods

Method Description
GetAllList ( string url ) : string[]

获取FTP文件列表(包括文件夹)

Method Details

Delete() public method

删除文件
public Delete ( string fileName ) : void
fileName string
return void

Download() public method

下载
public Download ( string filePath, string fileName ) : void
filePath string
fileName string
return void

DownloadFile() public method

public DownloadFile ( string filePath, string fileName, string &info ) : bool
filePath string
fileName string
info string
return bool

FTPHelper() public method

连接FTP服务器
public FTPHelper ( string FtpServerIP, string FtpRemotePath, string FtpUserID, string FtpPassword ) : System
FtpServerIP string FTP连接地址
FtpRemotePath string 指定FTP连接成功后的当前目录, 如果不指定即默认为根目录
FtpUserID string 用户名
FtpPassword string 密码
return System

FileExist() public method

判断当前目录下指定的文件是否存在
public FileExist ( string RemoteFileName ) : bool
RemoteFileName string 远程文件名
return bool

GetFileList() public method

获取当前目录下文件列表(不包括文件夹)
public GetFileList ( string url ) : string[]
url string
return string[]

GetFileSize() public method

获取指定文件大小
public GetFileSize ( string filename ) : long
filename string
return long

GetFilesDetailList() public method

获取当前目录下明细(包含文件和文件夹)
public GetFilesDetailList ( ) : string[]
return string[]

GotoDirectory() public method

切换当前目录
public GotoDirectory ( string DirectoryName, bool IsRoot ) : void
DirectoryName string
IsRoot bool true:绝对路径 false:相对路径
return void

MakeDir() public method

创建文件夹
public MakeDir ( string dirName ) : void
dirName string
return void

MovieFile() public method

移动文件
public MovieFile ( string currentFilename, string newDirectory ) : void
currentFilename string
newDirectory string
return void

ReName() public method

更改文件名
public ReName ( string currentFilename, string newFilename ) : void
currentFilename string
newFilename string
return void

Upload() public method

上传
public Upload ( string filename ) : void
filename string
return void

UploadFile() public method

public UploadFile ( string filename, string &info ) : bool
filename string
info string
return bool