Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions docfx/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,17 @@ using (var client = new SshClient("sftp.foo.com", "guest", "pwd"))
// Make the server echo back the input file with "cat"
using (SshCommand command = client.CreateCommand("cat"))
{
IAsyncResult asyncResult = command.BeginExecute();
Task executeTask = command.ExecuteAsync(CancellationToken.None);

using (Stream inputStream = command.CreateInputStream())
{
inputStream.Write("Hello World!"u8);
}

string result = command.EndExecute(asyncResult);
await executeTask;

Console.WriteLine(result); // "Hello World!"
Console.WriteLine(command.ExitStatus); // 0
Console.WriteLine(command.Result); // "Hello World!"
}
}
```
8 changes: 8 additions & 0 deletions src/Renci.SshNet/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -180,3 +180,11 @@ dotnet_diagnostic.CA5350.severity = none
# CA5351: Do Not Use Broken Cryptographic Algorithms
# https://learn.microsoft.com/en-ca/dotnet/fundamentals/code-analysis/quality-rules/ca5351
dotnet_diagnostic.CA5351.severity = none

# MA0040: Forward the CancellationToken parameter to methods that take one
# Partial/noisy duplicate of CA2016
dotnet_diagnostic.MA0040.severity = none

# MA0042: Do not use blocking calls in an async method
# duplicate of CA1849
dotnet_diagnostic.MA0042.severity = none
60 changes: 0 additions & 60 deletions src/Renci.SshNet/CommandAsyncResult.cs

This file was deleted.

Loading