Back to product page
- Introduction
- License agreement
- Classes
- Enumerations
- Exceptions
- WeOnlyDo.Client.SFTP
- Methods
- Properties
- Authentication
- Blocking
- BufferSize
- Compression
- Encryption
- EncryptionList
- HMacList
- Hostname
- KeepAlives
- KeyExchangeList
- LastError
- ListItem
- LocalPath
- Login
- MaxTransferRate
- Password
- Port
- PrivateKey
- ProxyHostname
- ProxyLogin
- ProxyPassword
- ProxyPort
- ProxyType
- RemoteIdentification
- RemotePath
- Resume
- State
- Timeout
- TransferMode
- TransferRate
- TransferTime
- Version
- Events
- How to get support?
RemoteWrite method
Writes to remote file.
Type
VoidSyntax
- C#
- VB.NET
public Void RemoteWrite(Byte[] Data, Int64 RemotePos);
The RemoteWrite(Data,RemotePos) syntax has these parts:
public Void RemoteWrite(String Data, Int64 RemotePos);
The RemoteWrite(Data,RemotePos) syntax has these parts:
public Void RemoteWrite(Byte[] Data, Int32 Offset, Int32 Count, Int64 RemotePos);
The RemoteWrite(Data,Offset,Count,RemotePos) syntax has these parts:
The RemoteWrite(Data,RemotePos) syntax has these parts:
Data | Holds data to be written in remote file. |
RemotePos | Position in the remote file where write occurs. |
public Void RemoteWrite(String Data, Int64 RemotePos);
The RemoteWrite(Data,RemotePos) syntax has these parts:
Data | Holds data to be written in remote file. |
RemotePos | Position in the remote file where write occurs. |
public Void RemoteWrite(Byte[] Data, Int32 Offset, Int32 Count, Int64 RemotePos);
The RemoteWrite(Data,Offset,Count,RemotePos) syntax has these parts:
Data | Holds data to be written in remote file. |
Offset | Offset of data in Data buffer. |
Count | Total number of bytes to write from the Data buffer. |
RemotePos | Position in the remote file where write occurs. |
public Sub RemoteWrite(ByVal Data As Byte[], ByVal RemotePos As Int64)
The RemoteWrite(Data,RemotePos) syntax has these parts:
public Sub RemoteWrite(ByVal Data As String, ByVal RemotePos As Int64)
The RemoteWrite(Data,RemotePos) syntax has these parts:
public Sub RemoteWrite(ByVal Data As Byte[], ByVal Offset As Int32, ByVal Count As Int32, ByVal RemotePos As Int64)
The RemoteWrite(Data,Offset,Count,RemotePos) syntax has these parts:
The RemoteWrite(Data,RemotePos) syntax has these parts:
Data | Holds data to be written in remote file. |
RemotePos | Position in the remote file where write occurs. |
public Sub RemoteWrite(ByVal Data As String, ByVal RemotePos As Int64)
The RemoteWrite(Data,RemotePos) syntax has these parts:
Data | Holds data to be written in remote file. |
RemotePos | Position in the remote file where write occurs. |
public Sub RemoteWrite(ByVal Data As Byte[], ByVal Offset As Int32, ByVal Count As Int32, ByVal RemotePos As Int64)
The RemoteWrite(Data,Offset,Count,RemotePos) syntax has these parts:
Data | Holds data to be written in remote file. |
Offset | Offset of data in Data buffer. |
Count | Total number of bytes to write from the Data buffer. |
RemotePos | Position in the remote file where write occurs. |
Remarks
The RemoteWrite method write Data to specific position in remote file, opened with RemoteOpen method. When data is fully written, Done event will be fired where you can write more data, close the file etc.. During the transfer, Progress event WILL NOT be fired.You can, for example, write data like this:
WeOnlyDo.Client.SFTP sftp1 = new WeOnlyDo.Client.SFTP();
sftp1.Hostname = "x.y.z";
sftp1.Login = "xyz";
sftp1.Password = "abc";
sftp1.Blocking = true;
sftp1.Connect();
sftp1.RemoteOpen("/tmp/newfile",
WeOnlyDo.Client.SFTP.RemotePermissions.Read |
WeOnlyDo.Client.SFTP.RemotePermissions.Write |
WeOnlyDo.Client.SFTP.RemotePermissions.Truncate |
WeOnlyDo.Client.SFTP.RemotePermissions.Create);
sftp1.RemoteWrite("this is a test", 0);
sftp1.RemoteWrite("another test", 10);
byte[] b = sftp1.RemoteRead(0, -1);
MessageBox.Show(new String(System.Text.Encoding.ASCII.GetChars(b)));
sftp1.RemoteClose();
After you finish writing all the data, don't forget to call RemoteClose. You can not call other methods until RemoteClose is called (for example, you cannot call PutFile).