C# 클래스 CSharpUtils.Net.FTP

파일 보기 프로젝트 열기: soywiz/csharputils 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
pass string
port int
server string
user string

보호된 프로퍼티들

프로퍼티 타입 설명
_timeout int

공개 메소드들

메소드 설명
ChangeDir ( string path ) : void

Change to another directory on the ftp server

Connect ( ) : void

Connect to an ftp server

Connect ( string server, int port, string user, string pass ) : void

Connect to a ftp server

Connect ( string server, string user, string pass ) : void

Connect to a ftp server

Disconnect ( ) : void

Closes all connections to the ftp server

DoDownload ( ) : long

Download a file, to be used in a loop until the file is completely downloaded

DoUpload ( ) : long

Upload the file, to be used in a loop until file is completely uploaded

FTP ( ) : System

Constructor

FTP ( string server, int port, string user, string pass ) : System

Constructor

FTP ( string server, string user, string pass ) : System

Constructor

GetFileDate ( string fileName ) : System.DateTime

GetFileDate will query the ftp server for the date of the remote file.

GetFileDateRaw ( string fileName ) : string

Returns the 'Raw' DateInformation in ftp format. (YYYYMMDDhhmmss). Use GetFileDate to return a DateTime object as a better option.

GetFileSize ( string filename ) : long

Get the size of a file (Provided the ftp server supports it)

GetWorkingDirectory ( ) : string

Get the working directory on the ftp server

List ( ) : ArrayList

Retrieves a list of files from the ftp server

ListDirectories ( ) : ArrayList

Gets a directory list only

ListEntries ( ) : LinkedList

List FTPEntry items with the current path on the FTP connection.

ListFiles ( ) : ArrayList

Gets a file list only

MakeDir ( string dir ) : void

Create a directory on the ftp server

OpenDownload ( string remote_filename, string local_filename, bool resume = false ) : void

Open a file for download

OpenUpload ( Stream _file, string remote_filename, bool resume = false ) : void

Open an upload with resume support

OpenUpload ( string filename, string remote_filename, bool resume = false ) : void
RemoveDir ( string dir ) : void

Remove a directory from the ftp server

RemoveFile ( string filename ) : void

Remove a file from the ftp server

RenameFile ( string oldfilename, string newfilename ) : void

Rename a file on the ftp server

보호된 메소드들

메소드 설명
SetSocketTimeout ( Socket Socket ) : void
SetSocketTimeout ( Socket Socket, int Timeout ) : void

비공개 메소드들

메소드 설명
CloseDataSocket ( ) : void
ConnectDataSocket ( ) : void
ConvertFTPDateToDateTime ( string input ) : System.DateTime
Fail ( ) : void
OpenDataSocket ( ) : void
ReadResponse ( ) : void
SendCommand ( string command ) : void
SetBinaryMode ( bool mode ) : void

메소드 상세

ChangeDir() 공개 메소드

Change to another directory on the ftp server
public ChangeDir ( string path ) : void
path string Directory to change to
리턴 void

Connect() 공개 메소드

Connect to an ftp server
public Connect ( ) : void
리턴 void

Connect() 공개 메소드

Connect to a ftp server
public Connect ( string server, int port, string user, string pass ) : void
server string IP or hostname of the server to connect to
port int Port number the server is listening on
user string Account name to login as
pass string Password for the account specified
리턴 void

Connect() 공개 메소드

Connect to a ftp server
public Connect ( string server, string user, string pass ) : void
server string IP or hostname of the server to connect to
user string Account name to login as
pass string Password for the account specified
리턴 void

Disconnect() 공개 메소드

Closes all connections to the ftp server
public Disconnect ( ) : void
리턴 void

DoDownload() 공개 메소드

Download a file, to be used in a loop until the file is completely downloaded
public DoDownload ( ) : long
리턴 long

DoUpload() 공개 메소드

Upload the file, to be used in a loop until file is completely uploaded
public DoUpload ( ) : long
리턴 long

FTP() 공개 메소드

Constructor
public FTP ( ) : System
리턴 System

FTP() 공개 메소드

Constructor
public FTP ( string server, int port, string user, string pass ) : System
server string Server to connect to
port int Port server is listening on
user string Account to login as
pass string Account password
리턴 System

FTP() 공개 메소드

Constructor
public FTP ( string server, string user, string pass ) : System
server string Server to connect to
user string Account to login as
pass string Account password
리턴 System

GetFileDate() 공개 메소드

GetFileDate will query the ftp server for the date of the remote file.
public GetFileDate ( string fileName ) : System.DateTime
fileName string Remote FileName to Query
리턴 System.DateTime

GetFileDateRaw() 공개 메소드

Returns the 'Raw' DateInformation in ftp format. (YYYYMMDDhhmmss). Use GetFileDate to return a DateTime object as a better option.
public GetFileDateRaw ( string fileName ) : string
fileName string Remote FileName to Query
리턴 string

GetFileSize() 공개 메소드

Get the size of a file (Provided the ftp server supports it)
public GetFileSize ( string filename ) : long
filename string Name of file
리턴 long

GetWorkingDirectory() 공개 메소드

Get the working directory on the ftp server
public GetWorkingDirectory ( ) : string
리턴 string

List() 공개 메소드

Retrieves a list of files from the ftp server
public List ( ) : ArrayList
리턴 System.Collections.ArrayList

ListDirectories() 공개 메소드

Gets a directory list only
public ListDirectories ( ) : ArrayList
리턴 System.Collections.ArrayList

ListEntries() 공개 메소드

List FTPEntry items with the current path on the FTP connection.
public ListEntries ( ) : LinkedList
리턴 LinkedList

ListFiles() 공개 메소드

Gets a file list only
public ListFiles ( ) : ArrayList
리턴 System.Collections.ArrayList

MakeDir() 공개 메소드

Create a directory on the ftp server
public MakeDir ( string dir ) : void
dir string Directory to create
리턴 void

OpenDownload() 공개 메소드

Open a file for download
public OpenDownload ( string remote_filename, string local_filename, bool resume = false ) : void
remote_filename string The name of the file on the FTP server
local_filename string The name of the file to save as (Can include path to file)
resume bool Attempt resume if file exists
리턴 void

OpenUpload() 공개 메소드

Open an upload with resume support
public OpenUpload ( Stream _file, string remote_filename, bool resume = false ) : void
_file Stream Local file to upload (Can include path to file)
remote_filename string Filename to store file as on ftp server
resume bool Attempt resume if exists
리턴 void

OpenUpload() 공개 메소드

public OpenUpload ( string filename, string remote_filename, bool resume = false ) : void
filename string
remote_filename string
resume bool
리턴 void

RemoveDir() 공개 메소드

Remove a directory from the ftp server
public RemoveDir ( string dir ) : void
dir string Name of directory to remove
리턴 void

RemoveFile() 공개 메소드

Remove a file from the ftp server
public RemoveFile ( string filename ) : void
filename string Name of the file to delete
리턴 void

RenameFile() 공개 메소드

Rename a file on the ftp server
public RenameFile ( string oldfilename, string newfilename ) : void
oldfilename string Old file name
newfilename string New file name
리턴 void

SetSocketTimeout() 보호된 메소드

protected SetSocketTimeout ( Socket Socket ) : void
Socket Socket
리턴 void

SetSocketTimeout() 보호된 메소드

protected SetSocketTimeout ( Socket Socket, int Timeout ) : void
Socket Socket
Timeout int
리턴 void

프로퍼티 상세

_timeout 보호되어 있는 프로퍼티

protected int _timeout
리턴 int

pass 공개적으로 프로퍼티

Password for account
public string pass
리턴 string

port 공개적으로 프로퍼티

Port number the FTP server is listening on
public int port
리턴 int

server 공개적으로 프로퍼티

IP address or hostname to connect to
public string server
리턴 string

user 공개적으로 프로퍼티

Username to login as
public string user
리턴 string