C# 클래스 Renci.SshNet.SftpClient

상속: BaseClient
파일 보기 프로젝트 열기: sshnet/SSH.NET 1 사용 예제들

공개 메소드들

메소드 설명
AppendAllLines ( string path, IEnumerable contents ) : void

Appends lines to a file, and closes the file.

AppendAllLines ( string path, IEnumerable contents, Encoding encoding ) : void

Appends lines to a file by using a specified encoding, and closes the file.

AppendAllText ( string path, string contents ) : void

Appends the specified string to the file, and closes the file.

AppendAllText ( string path, string contents, Encoding encoding ) : void

Appends the specified string to the file, and closes the file.

AppendText ( string path ) : StreamWriter

Creates a StreamWriter that appends UTF-8 encoded text to an existing file.

AppendText ( string path, Encoding encoding ) : StreamWriter

Creates a StreamWriter that appends text to an existing file using the specified encoding.

BeginDownloadFile ( string path, Stream output ) : IAsyncResult

Begins an asynchronous file downloading into the stream.

Method calls made by this method to output, may under certain conditions result in exceptions thrown by the stream.

BeginDownloadFile ( string path, Stream output, AsyncCallback asyncCallback ) : IAsyncResult

Begins an asynchronous file downloading into the stream.

Method calls made by this method to output, may under certain conditions result in exceptions thrown by the stream.

BeginDownloadFile ( string path, Stream output, AsyncCallback asyncCallback, object state, Action downloadCallback = null ) : IAsyncResult

Begins an asynchronous file downloading into the stream.

Method calls made by this method to output, may under certain conditions result in exceptions thrown by the stream.

BeginListDirectory ( string path, AsyncCallback asyncCallback, object state, Action listCallback = null ) : IAsyncResult

Begins an asynchronous operation of retrieving list of files in remote directory.

BeginSynchronizeDirectories ( string sourcePath, string destinationPath, string searchPattern, AsyncCallback asyncCallback, object state ) : IAsyncResult

Begins the synchronize directories.

BeginUploadFile ( Stream input, string path ) : IAsyncResult

Begins an asynchronous uploading the stream into remote file.

Method calls made by this method to input, may under certain conditions result in exceptions thrown by the stream.

If the remote file already exists, it is overwritten and truncated.

BeginUploadFile ( Stream input, string path, AsyncCallback asyncCallback ) : IAsyncResult

Begins an asynchronous uploading the stream into remote file.

Method calls made by this method to input, may under certain conditions result in exceptions thrown by the stream.

If the remote file already exists, it is overwritten and truncated.

BeginUploadFile ( Stream input, string path, AsyncCallback asyncCallback, object state, Action uploadCallback = null ) : IAsyncResult

Begins an asynchronous uploading the stream into remote file.

Method calls made by this method to input, may under certain conditions result in exceptions thrown by the stream.

If the remote file already exists, it is overwritten and truncated.

BeginUploadFile ( Stream input, string path, bool canOverride, AsyncCallback asyncCallback, object state, Action uploadCallback = null ) : IAsyncResult

Begins an asynchronous uploading the stream into remote file.

Method calls made by this method to input, may under certain conditions result in exceptions thrown by the stream.

When path refers to an existing file, set canOverride to true to overwrite and truncate that file. If canOverride is false, the upload will fail and EndUploadFile(IAsyncResult) will throw an SshException.

ChangeDirectory ( string path ) : void

Changes remote directory to path.

ChangePermissions ( string path, short mode ) : void

Changes permissions of file(s) to specified mode.

Create ( string path ) : SftpFileStream

Creates or overwrites a file in the specified path.

If the target file already exists, it is first truncated to zero bytes.

Create ( string path, int bufferSize ) : SftpFileStream

Creates or overwrites the specified file.

If the target file already exists, it is first truncated to zero bytes.

CreateDirectory ( string path ) : void

Creates remote directory specified by path.

CreateText ( string path ) : StreamWriter

Creates or opens a file for writing UTF-8 encoded text.

If the target file already exists, it is overwritten. It is not first truncated to zero bytes.

If the target file does not exist, it is created.

CreateText ( string path, Encoding encoding ) : StreamWriter

Creates or opens a file for writing text using the specified encoding.

If the target file already exists, it is overwritten. It is not first truncated to zero bytes.

If the target file does not exist, it is created.

Delete ( string path ) : void

Deletes the specified file or directory.

DeleteDirectory ( string path ) : void

Deletes remote directory specified by path.

DeleteFile ( string path ) : void

Deletes remote file specified by path.

DownloadFile ( string path, Stream output, Action downloadCallback = null ) : void

Downloads remote file specified by the path into the stream.

Method calls made by this method to output, may under certain conditions result in exceptions thrown by the stream.

EndDownloadFile ( IAsyncResult asyncResult ) : void

Ends an asynchronous file downloading into the stream.

EndListDirectory ( IAsyncResult asyncResult ) : IEnumerable

Ends an asynchronous operation of retrieving list of files in remote directory.

EndSynchronizeDirectories ( IAsyncResult asyncResult ) : IEnumerable

Ends the synchronize directories.

EndUploadFile ( IAsyncResult asyncResult ) : void

Ends an asynchronous uploading the stream into remote file.

Exists ( string path ) : bool

Checks whether file or directory exists;

Get ( string path ) : SftpFile

Gets reference to remote file or directory.

GetAttributes ( string path ) : SftpFileAttributes

Gets the SftpFileAttributes of the file on the path.

GetLastAccessTime ( string path ) : DateTime

Returns the date and time the specified file or directory was last accessed.

GetLastAccessTimeUtc ( string path ) : DateTime

Returns the date and time, in coordinated universal time (UTC), that the specified file or directory was last accessed.

GetLastWriteTime ( string path ) : DateTime

Returns the date and time the specified file or directory was last written to.

GetLastWriteTimeUtc ( string path ) : DateTime

Returns the date and time, in coordinated universal time (UTC), that the specified file or directory was last written to.

GetStatus ( string path ) : SftpFileSytemInformation

Gets status using [email protected] request.

ListDirectory ( string path, Action listCallback = null ) : IEnumerable

Retrieves list of files in remote directory.

Open ( string path, FileMode mode ) : SftpFileStream

Opens a SftpFileStream on the specified path with read/write access.

Open ( string path, FileMode mode, FileAccess access ) : SftpFileStream

Opens a SftpFileStream on the specified path, with the specified mode and access.

OpenRead ( string path ) : SftpFileStream

Opens an existing file for reading.

OpenText ( string path ) : StreamReader

Opens an existing UTF-8 encoded text file for reading.

OpenWrite ( string path ) : SftpFileStream

Opens a file for writing.

If the file does not exist, it is created.

ReadAllBytes ( string path ) : byte[]

Opens a binary file, reads the contents of the file into a byte array, and closes the file.

ReadAllLines ( string path ) : string[]

Opens a text file, reads all lines of the file using UTF-8 encoding, and closes the file.

ReadAllLines ( string path, Encoding encoding ) : string[]

Opens a file, reads all lines of the file with the specified encoding, and closes the file.

ReadAllText ( string path ) : string

Opens a text file, reads all lines of the file with the UTF-8 encoding, and closes the file.

ReadAllText ( string path, Encoding encoding ) : string

Opens a file, reads all lines of the file with the specified encoding, and closes the file.

ReadLines ( string path ) : IEnumerable

Reads the lines of a file with the UTF-8 encoding.

ReadLines ( string path, Encoding encoding ) : IEnumerable

Read the lines of a file that has a specified encoding.

RenameFile ( string oldPath, string newPath ) : void

Renames remote file from old path to new path.

RenameFile ( string oldPath, string newPath, bool isPosix ) : void

Renames remote file from old path to new path.

SetAttributes ( string path, SftpFileAttributes fileAttributes ) : void

Sets the specified SftpFileAttributes of the file on the specified path.

SftpClient ( ConnectionInfo connectionInfo ) : System

Initializes a new instance of the SftpClient class.

SftpClient ( string host, string username ) : System

Initializes a new instance of the SftpClient class.

SftpClient ( string host, string username, string password ) : System

Initializes a new instance of the SftpClient class.

SymbolicLink ( string path, string linkPath ) : void

Creates a symbolic link from old path to new path.

SynchronizeDirectories ( string sourcePath, string destinationPath, string searchPattern ) : IEnumerable

Synchronizes the directories.

UploadFile ( Stream input, string path, Action uploadCallback = null ) : void

Uploads stream into remote file.

Method calls made by this method to input, may under certain conditions result in exceptions thrown by the stream.

UploadFile ( Stream input, string path, bool canOverride, Action uploadCallback = null ) : void

Uploads stream into remote file.

Method calls made by this method to input, may under certain conditions result in exceptions thrown by the stream.

WriteAllBytes ( string path, byte bytes ) : void

Writes the specified byte array to the specified file, and closes the file.

If the target file already exists, it is overwritten. It is not first truncated to zero bytes.

If the target file does not exist, it is created.

WriteAllLines ( string path, IEnumerable contents ) : void

Writes a collection of strings to the file using the UTF-8 encoding, and closes the file.

If the target file already exists, it is overwritten. It is not first truncated to zero bytes.

If the target file does not exist, it is created.

WriteAllLines ( string path, IEnumerable contents, Encoding encoding ) : void

Writes a collection of strings to the file using the specified encoding, and closes the file.

If the target file already exists, it is overwritten. It is not first truncated to zero bytes.

If the target file does not exist, it is created.

WriteAllLines ( string path, string contents ) : void

Write the specified string array to the file using the UTF-8 encoding, and closes the file.

If the target file already exists, it is overwritten. It is not first truncated to zero bytes.

If the target file does not exist, it is created.

WriteAllLines ( string path, string contents, Encoding encoding ) : void

Writes the specified string array to the file by using the specified encoding, and closes the file.

If the target file already exists, it is overwritten. It is not first truncated to zero bytes.

If the target file does not exist, it is created.

WriteAllText ( string path, string contents ) : void

Writes the specified string to the file using the UTF-8 encoding, and closes the file.

If the target file already exists, it is overwritten. It is not first truncated to zero bytes.

If the target file does not exist, it is created.

WriteAllText ( string path, string contents, Encoding encoding ) : void

Writes the specified string to the file using the specified encoding, and closes the file.

If the target file already exists, it is overwritten. It is not first truncated to zero bytes.

If the target file does not exist, it is created.

보호된 메소드들

메소드 설명
Dispose ( bool disposing ) : void

Releases unmanaged and - optionally - managed resources

OnConnected ( ) : void

Called when client is connected to the server.

OnDisconnecting ( ) : void

Called when client is disconnecting from the server.

비공개 메소드들

메소드 설명
InternalDownloadFile ( string path, Stream output, SftpDownloadAsyncResult asyncResult, Action downloadCallback ) : void

Internals the download file.

InternalListDirectory ( string path, Action listCallback ) : IEnumerable

Internals the list directory.

InternalSynchronizeDirectories ( string sourcePath, string destinationPath, string searchPattern, SftpSynchronizeDirectoriesAsyncResult asynchResult ) : IEnumerable
InternalUploadFile ( Stream input, string path, Flags flags, SftpUploadAsyncResult asyncResult, Action uploadCallback ) : void

Internals the upload file.

SetLastAccessTime ( string path, DateTime lastAccessTime ) : void
SetLastAccessTimeUtc ( string path, DateTime lastAccessTimeUtc ) : void
SetLastWriteTime ( string path, DateTime lastWriteTime ) : void
SetLastWriteTimeUtc ( string path, DateTime lastWriteTimeUtc ) : void
SftpClient ( ConnectionInfo connectionInfo, bool ownsConnectionInfo ) : System

Initializes a new instance of the SftpClient class.

If ownsConnectionInfo is true, the connection info will be disposed when this instance is disposed.

SftpClient ( ConnectionInfo connectionInfo, bool ownsConnectionInfo, IServiceFactory serviceFactory ) : System

Initializes a new instance of the SftpClient class.

If ownsConnectionInfo is true, the connection info will be disposed when this instance is disposed.

SftpClient ( string host, int port, string username ) : System
SftpClient ( string host, int port, string username, string password ) : System

메소드 상세

AppendAllLines() 공개 메소드

Appends lines to a file, and closes the file.
isnull -or- is null. Client is not connected. was not found on the remote host. The method was called after the client was disposed.
public AppendAllLines ( string path, IEnumerable contents ) : void
path string The file to append the lines to. The file is created if it does not already exist.
contents IEnumerable The lines to append to the file.
리턴 void

AppendAllLines() 공개 메소드

Appends lines to a file by using a specified encoding, and closes the file.
is null. -or- is null. -or- is null. Client is not connected. was not found on the remote host. The method was called after the client was disposed.
public AppendAllLines ( string path, IEnumerable contents, Encoding encoding ) : void
path string The file to append the lines to. The file is created if it does not already exist.
contents IEnumerable The lines to append to the file.
encoding System.Text.Encoding The character encoding to use.
리턴 void

AppendAllText() 공개 메소드

Appends the specified string to the file, and closes the file.
is null. -or- is null. Client is not connected. was not found on the remote host. The method was called after the client was disposed.
public AppendAllText ( string path, string contents ) : void
path string The file to append the specified string to.
contents string The string to append to the file.
리턴 void

AppendAllText() 공개 메소드

Appends the specified string to the file, and closes the file.
is null. -or- is null. -or- is null. Client is not connected. was not found on the remote host. The method was called after the client was disposed.
public AppendAllText ( string path, string contents, Encoding encoding ) : void
path string The file to append the specified string to.
contents string The string to append to the file.
encoding System.Text.Encoding The character encoding to use.
리턴 void

AppendText() 공개 메소드

Creates a StreamWriter that appends UTF-8 encoded text to an existing file.
is null. Client is not connected. was not found on the remote host. The method was called after the client was disposed.
public AppendText ( string path ) : StreamWriter
path string The path to the file to append to.
리턴 System.IO.StreamWriter

AppendText() 공개 메소드

Creates a StreamWriter that appends text to an existing file using the specified encoding.
is null. -or- is null. Client is not connected. was not found on the remote host. The method was called after the client was disposed.
public AppendText ( string path, Encoding encoding ) : StreamWriter
path string The path to the file to append to.
encoding System.Text.Encoding The character encoding to use.
리턴 System.IO.StreamWriter

BeginDownloadFile() 공개 메소드

Begins an asynchronous file downloading into the stream.
Method calls made by this method to output, may under certain conditions result in exceptions thrown by the stream.
is null. is null or contains only whitespace characters. Client is not connected. Permission to perform the operation was denied by the remote host. -or- A SSH command was denied by the server. A SSH error where is the message from the remote host. The method was called after the client was disposed.
public BeginDownloadFile ( string path, Stream output ) : IAsyncResult
path string The path.
output Stream The output.
리턴 IAsyncResult

BeginDownloadFile() 공개 메소드

Begins an asynchronous file downloading into the stream.
Method calls made by this method to output, may under certain conditions result in exceptions thrown by the stream.
is null. is null or contains only whitespace characters. Client is not connected. Permission to perform the operation was denied by the remote host. -or- A SSH command was denied by the server. A SSH error where is the message from the remote host. The method was called after the client was disposed.
public BeginDownloadFile ( string path, Stream output, AsyncCallback asyncCallback ) : IAsyncResult
path string The path.
output Stream The output.
asyncCallback AsyncCallback The method to be called when the asynchronous write operation is completed.
리턴 IAsyncResult

BeginDownloadFile() 공개 메소드

Begins an asynchronous file downloading into the stream.
Method calls made by this method to output, may under certain conditions result in exceptions thrown by the stream.
is null. is null or contains only whitespace characters. The method was called after the client was disposed.
public BeginDownloadFile ( string path, Stream output, AsyncCallback asyncCallback, object state, Action downloadCallback = null ) : IAsyncResult
path string The path.
output Stream The output.
asyncCallback AsyncCallback The method to be called when the asynchronous write operation is completed.
state object A user-provided object that distinguishes this particular asynchronous write request from other requests.
downloadCallback Action The download callback.
리턴 IAsyncResult

BeginListDirectory() 공개 메소드

Begins an asynchronous operation of retrieving list of files in remote directory.
The method was called after the client was disposed.
public BeginListDirectory ( string path, AsyncCallback asyncCallback, object state, Action listCallback = null ) : IAsyncResult
path string The path.
asyncCallback AsyncCallback The method to be called when the asynchronous write operation is completed.
state object A user-provided object that distinguishes this particular asynchronous write request from other requests.
listCallback Action The list callback.
리턴 IAsyncResult

BeginSynchronizeDirectories() 공개 메소드

Begins the synchronize directories.
is null. is null or contains only whitespace.
public BeginSynchronizeDirectories ( string sourcePath, string destinationPath, string searchPattern, AsyncCallback asyncCallback, object state ) : IAsyncResult
sourcePath string The source path.
destinationPath string The destination path.
searchPattern string The search pattern.
asyncCallback AsyncCallback The async callback.
state object The state.
리턴 IAsyncResult

BeginUploadFile() 공개 메소드

Begins an asynchronous uploading the stream into remote file.

Method calls made by this method to input, may under certain conditions result in exceptions thrown by the stream.

If the remote file already exists, it is overwritten and truncated.

is null. is null or contains only whitespace characters. Client is not connected. Permission to list the contents of the directory was denied by the remote host. -or- A SSH command was denied by the server. A SSH error where is the message from the remote host. The method was called after the client was disposed.
public BeginUploadFile ( Stream input, string path ) : IAsyncResult
input Stream Data input stream.
path string Remote file path.
리턴 IAsyncResult

BeginUploadFile() 공개 메소드

Begins an asynchronous uploading the stream into remote file.

Method calls made by this method to input, may under certain conditions result in exceptions thrown by the stream.

If the remote file already exists, it is overwritten and truncated.

is null. is null or contains only whitespace characters. Client is not connected. Permission to list the contents of the directory was denied by the remote host. -or- A SSH command was denied by the server. A SSH error where is the message from the remote host. The method was called after the client was disposed.
public BeginUploadFile ( Stream input, string path, AsyncCallback asyncCallback ) : IAsyncResult
input Stream Data input stream.
path string Remote file path.
asyncCallback AsyncCallback The method to be called when the asynchronous write operation is completed.
리턴 IAsyncResult

BeginUploadFile() 공개 메소드

Begins an asynchronous uploading the stream into remote file.

Method calls made by this method to input, may under certain conditions result in exceptions thrown by the stream.

If the remote file already exists, it is overwritten and truncated.

is null. is null or contains only whitespace characters. Client is not connected. Permission to list the contents of the directory was denied by the remote host. -or- A SSH command was denied by the server. A SSH error where is the message from the remote host. The method was called after the client was disposed.
public BeginUploadFile ( Stream input, string path, AsyncCallback asyncCallback, object state, Action uploadCallback = null ) : IAsyncResult
input Stream Data input stream.
path string Remote file path.
asyncCallback AsyncCallback The method to be called when the asynchronous write operation is completed.
state object A user-provided object that distinguishes this particular asynchronous write request from other requests.
uploadCallback Action The upload callback.
리턴 IAsyncResult

BeginUploadFile() 공개 메소드

Begins an asynchronous uploading the stream into remote file.

Method calls made by this method to input, may under certain conditions result in exceptions thrown by the stream.

When path refers to an existing file, set canOverride to true to overwrite and truncate that file. If canOverride is false, the upload will fail and EndUploadFile(IAsyncResult) will throw an SshException.

is null. is null or contains only whitespace characters. The method was called after the client was disposed.
public BeginUploadFile ( Stream input, string path, bool canOverride, AsyncCallback asyncCallback, object state, Action uploadCallback = null ) : IAsyncResult
input Stream Data input stream.
path string Remote file path.
canOverride bool Specified whether an existing file can be overwritten.
asyncCallback AsyncCallback The method to be called when the asynchronous write operation is completed.
state object A user-provided object that distinguishes this particular asynchronous write request from other requests.
uploadCallback Action The upload callback.
리턴 IAsyncResult

ChangeDirectory() 공개 메소드

Changes remote directory to path.
is null. Client is not connected. Permission to change directory denied by remote host. -or- A SSH command was denied by the server. was not found on the remote host. A SSH error where is the message from the remote host. The method was called after the client was disposed.
public ChangeDirectory ( string path ) : void
path string New directory path.
리턴 void

ChangePermissions() 공개 메소드

Changes permissions of file(s) to specified mode.
is null. Client is not connected. Permission to change permission on the path(s) was denied by the remote host. -or- A SSH command was denied by the server. was not found on the remote host. A SSH error where is the message from the remote host. The method was called after the client was disposed.
public ChangePermissions ( string path, short mode ) : void
path string File(s) path, may match multiple files.
mode short The mode.
리턴 void

Create() 공개 메소드

Creates or overwrites a file in the specified path.
If the target file already exists, it is first truncated to zero bytes.
is null. Client is not connected. The method was called after the client was disposed.
public Create ( string path ) : SftpFileStream
path string The path and name of the file to create.
리턴 Renci.SshNet.Sftp.SftpFileStream

Create() 공개 메소드

Creates or overwrites the specified file.
If the target file already exists, it is first truncated to zero bytes.
is null. Client is not connected. The method was called after the client was disposed.
public Create ( string path, int bufferSize ) : SftpFileStream
path string The path and name of the file to create.
bufferSize int The maximum number of bytes buffered for reads and writes to the file.
리턴 Renci.SshNet.Sftp.SftpFileStream

CreateDirectory() 공개 메소드

Creates remote directory specified by path.
is null or contains only whitespace characters. Client is not connected. Permission to create the directory was denied by the remote host. -or- A SSH command was denied by the server. A SSH error where is the message from the remote host. The method was called after the client was disposed.
public CreateDirectory ( string path ) : void
path string Directory path to create.
리턴 void

CreateText() 공개 메소드

Creates or opens a file for writing UTF-8 encoded text.

If the target file already exists, it is overwritten. It is not first truncated to zero bytes.

If the target file does not exist, it is created.

is null. Client is not connected. The method was called after the client was disposed.
public CreateText ( string path ) : StreamWriter
path string The file to be opened for writing.
리턴 System.IO.StreamWriter

CreateText() 공개 메소드

Creates or opens a file for writing text using the specified encoding.

If the target file already exists, it is overwritten. It is not first truncated to zero bytes.

If the target file does not exist, it is created.

is null. Client is not connected. The method was called after the client was disposed.
public CreateText ( string path, Encoding encoding ) : StreamWriter
path string The file to be opened for writing.
encoding Encoding The character encoding to use.
리턴 StreamWriter

Delete() 공개 메소드

Deletes the specified file or directory.
is null. Client is not connected. was not found on the remote host. The method was called after the client was disposed.
public Delete ( string path ) : void
path string The name of the file or directory to be deleted. Wildcard characters are not supported.
리턴 void

DeleteDirectory() 공개 메소드

Deletes remote directory specified by path.
is null or contains only whitespace characters. Client is not connected. was not found on the remote host. Permission to delete the directory was denied by the remote host. -or- A SSH command was denied by the server. A SSH error where is the message from the remote host. The method was called after the client was disposed.
public DeleteDirectory ( string path ) : void
path string Directory to be deleted path.
리턴 void

DeleteFile() 공개 메소드

Deletes remote file specified by path.
is null or contains only whitespace characters. Client is not connected. was not found on the remote host. Permission to delete the file was denied by the remote host. -or- A SSH command was denied by the server. A SSH error where is the message from the remote host. The method was called after the client was disposed.
public DeleteFile ( string path ) : void
path string File to be deleted path.
리턴 void

Dispose() 보호된 메소드

Releases unmanaged and - optionally - managed resources
protected Dispose ( bool disposing ) : void
disposing bool true to release both managed and unmanaged resources; false to release only unmanaged resources.
리턴 void

DownloadFile() 공개 메소드

Downloads remote file specified by the path into the stream.
Method calls made by this method to output, may under certain conditions result in exceptions thrown by the stream.
is null. is null or contains only whitespace characters. Client is not connected. Permission to perform the operation was denied by the remote host. -or- A SSH command was denied by the server. was not found on the remote host. A SSH error where is the message from the remote host. The method was called after the client was disposed.
public DownloadFile ( string path, Stream output, Action downloadCallback = null ) : void
path string File to download.
output Stream Stream to write the file into.
downloadCallback Action The download callback.
리턴 void

EndDownloadFile() 공개 메소드

Ends an asynchronous file downloading into the stream.
The object did not come from the corresponding async method on this type.-or- was called multiple times with the same . Client is not connected. Permission to perform the operation was denied by the remote host. -or- A SSH command was denied by the server. The path was not found on the remote host. A SSH error where is the message from the remote host.
public EndDownloadFile ( IAsyncResult asyncResult ) : void
asyncResult IAsyncResult The pending asynchronous SFTP request.
리턴 void

EndListDirectory() 공개 메소드

Ends an asynchronous operation of retrieving list of files in remote directory.
The object did not come from the corresponding async method on this type.-or- was called multiple times with the same .
public EndListDirectory ( IAsyncResult asyncResult ) : IEnumerable
asyncResult IAsyncResult The pending asynchronous SFTP request.
리턴 IEnumerable

EndSynchronizeDirectories() 공개 메소드

Ends the synchronize directories.
The object did not come from the corresponding async method on this type.-or- was called multiple times with the same . The destination path was not found on the remote host.
public EndSynchronizeDirectories ( IAsyncResult asyncResult ) : IEnumerable
asyncResult IAsyncResult The async result.
리턴 IEnumerable

EndUploadFile() 공개 메소드

Ends an asynchronous uploading the stream into remote file.
The object did not come from the corresponding async method on this type.-or- was called multiple times with the same . Client is not connected. The directory of the file was not found on the remote host. Permission to upload the file was denied by the remote host. -or- A SSH command was denied by the server. A SSH error where is the message from the remote host.
public EndUploadFile ( IAsyncResult asyncResult ) : void
asyncResult IAsyncResult The pending asynchronous SFTP request.
리턴 void

Exists() 공개 메소드

Checks whether file or directory exists;
is null or contains only whitespace characters. Client is not connected. Permission to perform the operation was denied by the remote host. -or- A SSH command was denied by the server. A SSH error where is the message from the remote host. The method was called after the client was disposed.
public Exists ( string path ) : bool
path string The path.
리턴 bool

Get() 공개 메소드

Gets reference to remote file or directory.
Client is not connected. was not found on the remote host. is null. The method was called after the client was disposed.
public Get ( string path ) : SftpFile
path string The path.
리턴 SftpFile

GetAttributes() 공개 메소드

Gets the SftpFileAttributes of the file on the path.
is null. Client is not connected. was not found on the remote host. The method was called after the client was disposed.
public GetAttributes ( string path ) : SftpFileAttributes
path string The path to the file.
리턴 SftpFileAttributes

GetLastAccessTime() 공개 메소드

Returns the date and time the specified file or directory was last accessed.
is null. Client is not connected. The method was called after the client was disposed.
public GetLastAccessTime ( string path ) : DateTime
path string The file or directory for which to obtain access date and time information.
리턴 DateTime

GetLastAccessTimeUtc() 공개 메소드

Returns the date and time, in coordinated universal time (UTC), that the specified file or directory was last accessed.
is null. Client is not connected. The method was called after the client was disposed.
public GetLastAccessTimeUtc ( string path ) : DateTime
path string The file or directory for which to obtain access date and time information.
리턴 DateTime

GetLastWriteTime() 공개 메소드

Returns the date and time the specified file or directory was last written to.
is null. Client is not connected. The method was called after the client was disposed.
public GetLastWriteTime ( string path ) : DateTime
path string The file or directory for which to obtain write date and time information.
리턴 DateTime

GetLastWriteTimeUtc() 공개 메소드

Returns the date and time, in coordinated universal time (UTC), that the specified file or directory was last written to.
is null. Client is not connected. The method was called after the client was disposed.
public GetLastWriteTimeUtc ( string path ) : DateTime
path string The file or directory for which to obtain write date and time information.
리턴 DateTime

GetStatus() 공개 메소드

Gets status using [email protected] request.
Client is not connected. is null. The method was called after the client was disposed.
public GetStatus ( string path ) : SftpFileSytemInformation
path string The path.
리턴 SftpFileSytemInformation

ListDirectory() 공개 메소드

Retrieves list of files in remote directory.
is null. Client is not connected. Permission to list the contents of the directory was denied by the remote host. -or- A SSH command was denied by the server. A SSH error where is the message from the remote host. The method was called after the client was disposed.
public ListDirectory ( string path, Action listCallback = null ) : IEnumerable
path string The path.
listCallback Action The list callback.
리턴 IEnumerable

OnConnected() 보호된 메소드

Called when client is connected to the server.
protected OnConnected ( ) : void
리턴 void

OnDisconnecting() 보호된 메소드

Called when client is disconnecting from the server.
protected OnDisconnecting ( ) : void
리턴 void

Open() 공개 메소드

Opens a SftpFileStream on the specified path with read/write access.
is null. Client is not connected. The method was called after the client was disposed.
public Open ( string path, FileMode mode ) : SftpFileStream
path string The file to open.
mode FileMode A value that specifies whether a file is created if one does not exist, and determines whether the contents of existing files are retained or overwritten.
리턴 SftpFileStream

Open() 공개 메소드

Opens a SftpFileStream on the specified path, with the specified mode and access.
is null. Client is not connected. The method was called after the client was disposed.
public Open ( string path, FileMode mode, FileAccess access ) : SftpFileStream
path string The file to open.
mode FileMode A value that specifies whether a file is created if one does not exist, and determines whether the contents of existing files are retained or overwritten.
access FileAccess A value that specifies the operations that can be performed on the file.
리턴 SftpFileStream

OpenRead() 공개 메소드

Opens an existing file for reading.
is null. Client is not connected. The method was called after the client was disposed.
public OpenRead ( string path ) : SftpFileStream
path string The file to be opened for reading.
리턴 SftpFileStream

OpenText() 공개 메소드

Opens an existing UTF-8 encoded text file for reading.
is null. Client is not connected. The method was called after the client was disposed.
public OpenText ( string path ) : StreamReader
path string The file to be opened for reading.
리턴 StreamReader

OpenWrite() 공개 메소드

Opens a file for writing.
If the file does not exist, it is created.
is null. Client is not connected. The method was called after the client was disposed.
public OpenWrite ( string path ) : SftpFileStream
path string The file to be opened for writing.
리턴 SftpFileStream

ReadAllBytes() 공개 메소드

Opens a binary file, reads the contents of the file into a byte array, and closes the file.
is null. Client is not connected. The method was called after the client was disposed.
public ReadAllBytes ( string path ) : byte[]
path string The file to open for reading.
리턴 byte[]

ReadAllLines() 공개 메소드

Opens a text file, reads all lines of the file using UTF-8 encoding, and closes the file.
is null. Client is not connected. The method was called after the client was disposed.
public ReadAllLines ( string path ) : string[]
path string The file to open for reading.
리턴 string[]

ReadAllLines() 공개 메소드

Opens a file, reads all lines of the file with the specified encoding, and closes the file.
is null. Client is not connected. The method was called after the client was disposed.
public ReadAllLines ( string path, Encoding encoding ) : string[]
path string The file to open for reading.
encoding Encoding The encoding applied to the contents of the file.
리턴 string[]

ReadAllText() 공개 메소드

Opens a text file, reads all lines of the file with the UTF-8 encoding, and closes the file.
is null. Client is not connected. The method was called after the client was disposed.
public ReadAllText ( string path ) : string
path string The file to open for reading.
리턴 string

ReadAllText() 공개 메소드

Opens a file, reads all lines of the file with the specified encoding, and closes the file.
is null. Client is not connected. The method was called after the client was disposed.
public ReadAllText ( string path, Encoding encoding ) : string
path string The file to open for reading.
encoding Encoding The encoding applied to the contents of the file.
리턴 string

ReadLines() 공개 메소드

Reads the lines of a file with the UTF-8 encoding.
is null. Client is not connected. The method was called after the client was disposed.
public ReadLines ( string path ) : IEnumerable
path string The file to read.
리턴 IEnumerable

ReadLines() 공개 메소드

Read the lines of a file that has a specified encoding.
is null. Client is not connected. The method was called after the client was disposed.
public ReadLines ( string path, Encoding encoding ) : IEnumerable
path string The file to read.
encoding Encoding The encoding that is applied to the contents of the file.
리턴 IEnumerable

RenameFile() 공개 메소드

Renames remote file from old path to new path.
is null. -or- or is null. Client is not connected. Permission to rename the file was denied by the remote host. -or- A SSH command was denied by the server. A SSH error where is the message from the remote host. The method was called after the client was disposed.
public RenameFile ( string oldPath, string newPath ) : void
oldPath string Path to the old file location.
newPath string Path to the new file location.
리턴 void

RenameFile() 공개 메소드

Renames remote file from old path to new path.
is null. -or- or is null. Client is not connected. Permission to rename the file was denied by the remote host. -or- A SSH command was denied by the server. A SSH error where is the message from the remote host. The method was called after the client was disposed.
public RenameFile ( string oldPath, string newPath, bool isPosix ) : void
oldPath string Path to the old file location.
newPath string Path to the new file location.
isPosix bool if set to true then perform a posix rename.
리턴 void

SetAttributes() 공개 메소드

Sets the specified SftpFileAttributes of the file on the specified path.
is null. Client is not connected. The method was called after the client was disposed.
public SetAttributes ( string path, SftpFileAttributes fileAttributes ) : void
path string The path to the file.
fileAttributes SftpFileAttributes The desired .
리턴 void

SftpClient() 공개 메소드

Initializes a new instance of the SftpClient class.
is null.
public SftpClient ( ConnectionInfo connectionInfo ) : System
connectionInfo ConnectionInfo The connection info.
리턴 System

SftpClient() 공개 메소드

Initializes a new instance of the SftpClient class.
is null. is invalid. -or- is null or contains only whitespace characters.
public SftpClient ( string host, string username ) : System
host string Connection host.
username string Authentication username.
리턴 System

SftpClient() 공개 메소드

Initializes a new instance of the SftpClient class.
is null. is invalid. -or- is null contains only whitespace characters.
public SftpClient ( string host, string username, string password ) : System
host string Connection host.
username string Authentication username.
password string Authentication password.
리턴 System

SymbolicLink() 공개 메소드

Creates a symbolic link from old path to new path.
is null. -or- is null or contains only whitespace characters. Client is not connected. Permission to create the symbolic link was denied by the remote host. -or- A SSH command was denied by the server. A SSH error where is the message from the remote host. The method was called after the client was disposed.
public SymbolicLink ( string path, string linkPath ) : void
path string The old path.
linkPath string The new path.
리턴 void

SynchronizeDirectories() 공개 메소드

Synchronizes the directories.
is null. is null or contains only whitespace. was not found on the remote host.
public SynchronizeDirectories ( string sourcePath, string destinationPath, string searchPattern ) : IEnumerable
sourcePath string The source path.
destinationPath string The destination path.
searchPattern string The search pattern.
리턴 IEnumerable

UploadFile() 공개 메소드

Uploads stream into remote file.
Method calls made by this method to input, may under certain conditions result in exceptions thrown by the stream.
is null. is null or contains only whitespace characters. Client is not connected. Permission to upload the file was denied by the remote host. -or- A SSH command was denied by the server. A SSH error where is the message from the remote host. The method was called after the client was disposed.
public UploadFile ( Stream input, string path, Action uploadCallback = null ) : void
input Stream Data input stream.
path string Remote file path.
uploadCallback Action The upload callback.
리턴 void

UploadFile() 공개 메소드

Uploads stream into remote file.
Method calls made by this method to input, may under certain conditions result in exceptions thrown by the stream.
is null. is null or contains only whitespace characters. Client is not connected. Permission to upload the file was denied by the remote host. -or- A SSH command was denied by the server. A SSH error where is the message from the remote host. The method was called after the client was disposed.
public UploadFile ( Stream input, string path, bool canOverride, Action uploadCallback = null ) : void
input Stream Data input stream.
path string Remote file path.
canOverride bool if set to true then existing file will be overwritten.
uploadCallback Action The upload callback.
리턴 void

WriteAllBytes() 공개 메소드

Writes the specified byte array to the specified file, and closes the file.

If the target file already exists, it is overwritten. It is not first truncated to zero bytes.

If the target file does not exist, it is created.

is null. Client is not connected. The method was called after the client was disposed.
public WriteAllBytes ( string path, byte bytes ) : void
path string The file to write to.
bytes byte The bytes to write to the file.
리턴 void

WriteAllLines() 공개 메소드

Writes a collection of strings to the file using the UTF-8 encoding, and closes the file.

If the target file already exists, it is overwritten. It is not first truncated to zero bytes.

If the target file does not exist, it is created.

is null. Client is not connected. The method was called after the client was disposed.
public WriteAllLines ( string path, IEnumerable contents ) : void
path string The file to write to.
contents IEnumerable The lines to write to the file.
리턴 void

WriteAllLines() 공개 메소드

Writes a collection of strings to the file using the specified encoding, and closes the file.

If the target file already exists, it is overwritten. It is not first truncated to zero bytes.

If the target file does not exist, it is created.

is null. Client is not connected. The method was called after the client was disposed.
public WriteAllLines ( string path, IEnumerable contents, Encoding encoding ) : void
path string The file to write to.
contents IEnumerable The lines to write to the file.
encoding Encoding The character encoding to use.
리턴 void

WriteAllLines() 공개 메소드

Write the specified string array to the file using the UTF-8 encoding, and closes the file.

If the target file already exists, it is overwritten. It is not first truncated to zero bytes.

If the target file does not exist, it is created.

is null. Client is not connected. The method was called after the client was disposed.
public WriteAllLines ( string path, string contents ) : void
path string The file to write to.
contents string The string array to write to the file.
리턴 void

WriteAllLines() 공개 메소드

Writes the specified string array to the file by using the specified encoding, and closes the file.

If the target file already exists, it is overwritten. It is not first truncated to zero bytes.

If the target file does not exist, it is created.

is null. Client is not connected. The method was called after the client was disposed.
public WriteAllLines ( string path, string contents, Encoding encoding ) : void
path string The file to write to.
contents string The string array to write to the file.
encoding Encoding An object that represents the character encoding applied to the string array.
리턴 void

WriteAllText() 공개 메소드

Writes the specified string to the file using the UTF-8 encoding, and closes the file.

If the target file already exists, it is overwritten. It is not first truncated to zero bytes.

If the target file does not exist, it is created.

is null. Client is not connected. The method was called after the client was disposed.
public WriteAllText ( string path, string contents ) : void
path string The file to write to.
contents string The string to write to the file.
리턴 void

WriteAllText() 공개 메소드

Writes the specified string to the file using the specified encoding, and closes the file.

If the target file already exists, it is overwritten. It is not first truncated to zero bytes.

If the target file does not exist, it is created.

is null. Client is not connected. The method was called after the client was disposed.
public WriteAllText ( string path, string contents, Encoding encoding ) : void
path string The file to write to.
contents string The string to write to the file.
encoding Encoding The encoding to apply to the string.
리턴 void