C# Class NFe.Components.FTP

Afficher le fichier Open project: akretion/uninfe Class Usage Examples

Méthodes publiques

Свойство Type Description
pass string
port int
server string
timeout int
user string

Méthodes publiques

Méthode Description
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

ListFiles ( ) : ArrayList

Gets a file list only

MakeDir ( string dir ) : void

Create a directory on the ftp server

OpenDownload ( string filename ) : void

Download a file with no resume

OpenDownload ( string filename, bool resume ) : void

Download a file with optional resume

OpenDownload ( string filename, string localfilename ) : void

Download a file with no attempt to resume

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

Open a file for download

OpenUpload ( string filename ) : void

Open an upload with no resume if it already exists

OpenUpload ( string filename, bool resume ) : void

Open an upload with resume support

OpenUpload ( string filename, string remotefilename ) : void

Open an upload with no resume if it already exists

OpenUpload ( string filename, string remote_filename, bool resume ) : void

Open an upload with resume support

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

UploadFile ( string filename, string remote_filename, bool resume ) : void
changeDir ( string path ) : bool
makeDir ( string path ) : void

Private Methods

Méthode Description
CloseDataSocket ( ) : void
ConnectDataSocket ( ) : void
ConvertFTPDateToDateTime ( string input ) : System.DateTime
Fail ( ) : void
FillBucket ( ) : void
GetLineFromBucket ( ) : string
OpenDataSocket ( ) : void
ReadResponse ( ) : void
SendCommand ( string command ) : void
SetBinaryMode ( bool mode ) : void

Method Details

ChangeDir() public méthode

Change to another directory on the ftp server
public ChangeDir ( string path ) : void
path string Directory to change to
Résultat void

Connect() public méthode

Connect to an ftp server
public Connect ( ) : void
Résultat void

Connect() public méthode

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
Résultat void

Connect() public méthode

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
Résultat void

Disconnect() public méthode

Closes all connections to the ftp server
public Disconnect ( ) : void
Résultat void

DoDownload() public méthode

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

DoUpload() public méthode

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

FTP() public méthode

Constructor
public FTP ( ) : System
Résultat System

FTP() public méthode

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
Résultat System

FTP() public méthode

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
Résultat System

GetFileDate() public méthode

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
Résultat System.DateTime

GetFileDateRaw() public méthode

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
Résultat string

GetFileSize() public méthode

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

GetWorkingDirectory() public méthode

Get the working directory on the ftp server
public GetWorkingDirectory ( ) : string
Résultat string

List() public méthode

Retrieves a list of files from the ftp server
public List ( ) : ArrayList
Résultat System.Collections.ArrayList

ListDirectories() public méthode

Gets a directory list only
public ListDirectories ( ) : ArrayList
Résultat System.Collections.ArrayList

ListFiles() public méthode

Gets a file list only
public ListFiles ( ) : ArrayList
Résultat System.Collections.ArrayList

MakeDir() public méthode

Create a directory on the ftp server
public MakeDir ( string dir ) : void
dir string Directory to create
Résultat void

OpenDownload() public méthode

Download a file with no resume
public OpenDownload ( string filename ) : void
filename string Remote file name
Résultat void

OpenDownload() public méthode

Download a file with optional resume
public OpenDownload ( string filename, bool resume ) : void
filename string Remote file name
resume bool Attempt resume if file exists
Résultat void

OpenDownload() public méthode

Download a file with no attempt to resume
public OpenDownload ( string filename, string localfilename ) : void
filename string Remote filename
localfilename string Local filename (Can include path to file)
Résultat void

OpenDownload() public méthode

Open a file for download
public OpenDownload ( string remote_filename, string local_filename, bool resume ) : 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
Résultat void

OpenUpload() public méthode

Open an upload with no resume if it already exists
public OpenUpload ( string filename ) : void
filename string File to upload
Résultat void

OpenUpload() public méthode

Open an upload with resume support
public OpenUpload ( string filename, bool resume ) : void
filename string Local file to upload (Can include path to file)
resume bool Attempt resume if exists
Résultat void

OpenUpload() public méthode

Open an upload with no resume if it already exists
public OpenUpload ( string filename, string remotefilename ) : void
filename string Local file to upload (Can include path to file)
remotefilename string Filename to store file as on ftp server
Résultat void

OpenUpload() public méthode

Open an upload with resume support
public OpenUpload ( string filename, string remote_filename, bool resume ) : void
filename string 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
Résultat void

RemoveDir() public méthode

Remove a directory from the ftp server
public RemoveDir ( string dir ) : void
dir string Name of directory to remove
Résultat void

RemoveFile() public méthode

Remove a file from the ftp server
public RemoveFile ( string filename ) : void
filename string Name of the file to delete
Résultat void

RenameFile() public méthode

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

UploadFile() public méthode

public UploadFile ( string filename, string remote_filename, bool resume ) : void
filename string
remote_filename string
resume bool
Résultat void

changeDir() public méthode

public changeDir ( string path ) : bool
path string
Résultat bool

makeDir() public méthode

public makeDir ( string path ) : void
path string
Résultat void

Property Details

pass public_oe property

Password for account
public string pass
Résultat string

port public_oe property

Port number the FTP server is listening on
public int port
Résultat int

server public_oe property

IP address or hostname to connect to
public string server
Résultat string

timeout public_oe property

The timeout (miliseconds) for waiting on data to arrive
public int timeout
Résultat int

user public_oe property

Username to login as
public string user
Résultat string