From 8bd42a06f18c406abec44bc674670ffcdad64420 Mon Sep 17 00:00:00 2001 From: olegkap_cp Date: Thu, 23 Dec 2010 21:06:07 +0000 Subject: [PATCH] Add some documentation content file to start creation of CHM help file --- Renci.SshClient/Renci.SshClient.sln | 18 -- .../{SshBaseClient.cs => BaseClient.cs} | 11 +- .../Extensibility.AddAuthenticationMethod.aml | 96 +++++++++++ .../Content/Extensibility.AddEncryption.aml | 96 +++++++++++ .../Extensibility.AddHashAlgorithm.aml | 96 +++++++++++ .../Documentation/Content/Extensibility.aml | 21 +++ .../Documentation/Content/HowTo.Connect.aml | 157 ++++++++++++++++++ .../Documentation/Content/HowTo.Sftp.aml | 50 ++++++ .../Content/HowTo.SshCommand.Run.aml | 68 ++++++++ .../Content/HowTo.SshCommand.aml | 50 ++++++ .../Documentation/Content/HowTo.aml | 50 ++++++ .../Documentation/Content/Introduction.aml | 48 ++++++ .../Documentation/Content/Reference.aml | 16 ++ .../Documentation/Renci.SshClient.content | 17 ++ .../Documentation/SshClient.shfbproj | 133 +++++++++++++++ .../Renci.SshClient/Renci.SshClient.csproj | 21 ++- Renci.SshClient/Renci.SshClient/SftpClient.cs | 2 +- Renci.SshClient/Renci.SshClient/SshClient.cs | 2 +- 18 files changed, 927 insertions(+), 25 deletions(-) rename Renci.SshClient/Renci.SshClient/{SshBaseClient.cs => BaseClient.cs} (90%) create mode 100644 Renci.SshClient/Renci.SshClient/Documentation/Content/Extensibility.AddAuthenticationMethod.aml create mode 100644 Renci.SshClient/Renci.SshClient/Documentation/Content/Extensibility.AddEncryption.aml create mode 100644 Renci.SshClient/Renci.SshClient/Documentation/Content/Extensibility.AddHashAlgorithm.aml create mode 100644 Renci.SshClient/Renci.SshClient/Documentation/Content/Extensibility.aml create mode 100644 Renci.SshClient/Renci.SshClient/Documentation/Content/HowTo.Connect.aml create mode 100644 Renci.SshClient/Renci.SshClient/Documentation/Content/HowTo.Sftp.aml create mode 100644 Renci.SshClient/Renci.SshClient/Documentation/Content/HowTo.SshCommand.Run.aml create mode 100644 Renci.SshClient/Renci.SshClient/Documentation/Content/HowTo.SshCommand.aml create mode 100644 Renci.SshClient/Renci.SshClient/Documentation/Content/HowTo.aml create mode 100644 Renci.SshClient/Renci.SshClient/Documentation/Content/Introduction.aml create mode 100644 Renci.SshClient/Renci.SshClient/Documentation/Content/Reference.aml create mode 100644 Renci.SshClient/Renci.SshClient/Documentation/Renci.SshClient.content create mode 100644 Renci.SshClient/Renci.SshClient/Documentation/SshClient.shfbproj diff --git a/Renci.SshClient/Renci.SshClient.sln b/Renci.SshClient/Renci.SshClient.sln index 1223442e..4c9a840e 100644 --- a/Renci.SshClient/Renci.SshClient.sln +++ b/Renci.SshClient/Renci.SshClient.sln @@ -29,9 +29,6 @@ Global Debug|Any CPU = Debug|Any CPU Debug|Mixed Platforms = Debug|Mixed Platforms Debug|x86 = Debug|x86 - DebugNoTimeout|Any CPU = DebugNoTimeout|Any CPU - DebugNoTimeout|Mixed Platforms = DebugNoTimeout|Mixed Platforms - DebugNoTimeout|x86 = DebugNoTimeout|x86 Release|Any CPU = Release|Any CPU Release|Mixed Platforms = Release|Mixed Platforms Release|x86 = Release|x86 @@ -42,11 +39,6 @@ Global {2F5F8C90-0BD1-424F-997C-7BC6280919D1}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {2F5F8C90-0BD1-424F-997C-7BC6280919D1}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {2F5F8C90-0BD1-424F-997C-7BC6280919D1}.Debug|x86.ActiveCfg = Debug|Any CPU - {2F5F8C90-0BD1-424F-997C-7BC6280919D1}.DebugNoTimeout|Any CPU.ActiveCfg = DebugNoTimeout|Any CPU - {2F5F8C90-0BD1-424F-997C-7BC6280919D1}.DebugNoTimeout|Any CPU.Build.0 = DebugNoTimeout|Any CPU - {2F5F8C90-0BD1-424F-997C-7BC6280919D1}.DebugNoTimeout|Mixed Platforms.ActiveCfg = DebugNoTimeout|Any CPU - {2F5F8C90-0BD1-424F-997C-7BC6280919D1}.DebugNoTimeout|Mixed Platforms.Build.0 = DebugNoTimeout|Any CPU - {2F5F8C90-0BD1-424F-997C-7BC6280919D1}.DebugNoTimeout|x86.ActiveCfg = DebugNoTimeout|Any CPU {2F5F8C90-0BD1-424F-997C-7BC6280919D1}.Release|Any CPU.ActiveCfg = Release|Any CPU {2F5F8C90-0BD1-424F-997C-7BC6280919D1}.Release|Any CPU.Build.0 = Release|Any CPU {2F5F8C90-0BD1-424F-997C-7BC6280919D1}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU @@ -57,11 +49,6 @@ Global {C45379B9-17B1-4E89-BC2E-6D41726413E8}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {C45379B9-17B1-4E89-BC2E-6D41726413E8}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {C45379B9-17B1-4E89-BC2E-6D41726413E8}.Debug|x86.ActiveCfg = Debug|Any CPU - {C45379B9-17B1-4E89-BC2E-6D41726413E8}.DebugNoTimeout|Any CPU.ActiveCfg = Debug|Any CPU - {C45379B9-17B1-4E89-BC2E-6D41726413E8}.DebugNoTimeout|Any CPU.Build.0 = Debug|Any CPU - {C45379B9-17B1-4E89-BC2E-6D41726413E8}.DebugNoTimeout|Mixed Platforms.ActiveCfg = Debug|Any CPU - {C45379B9-17B1-4E89-BC2E-6D41726413E8}.DebugNoTimeout|Mixed Platforms.Build.0 = Debug|Any CPU - {C45379B9-17B1-4E89-BC2E-6D41726413E8}.DebugNoTimeout|x86.ActiveCfg = Debug|Any CPU {C45379B9-17B1-4E89-BC2E-6D41726413E8}.Release|Any CPU.ActiveCfg = Release|Any CPU {C45379B9-17B1-4E89-BC2E-6D41726413E8}.Release|Any CPU.Build.0 = Release|Any CPU {C45379B9-17B1-4E89-BC2E-6D41726413E8}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU @@ -72,11 +59,6 @@ Global {E53AE1B6-5EE8-4B56-B59F-0E7370C8B886}.Debug|Mixed Platforms.Build.0 = Debug|x86 {E53AE1B6-5EE8-4B56-B59F-0E7370C8B886}.Debug|x86.ActiveCfg = Debug|x86 {E53AE1B6-5EE8-4B56-B59F-0E7370C8B886}.Debug|x86.Build.0 = Debug|x86 - {E53AE1B6-5EE8-4B56-B59F-0E7370C8B886}.DebugNoTimeout|Any CPU.ActiveCfg = Debug|x86 - {E53AE1B6-5EE8-4B56-B59F-0E7370C8B886}.DebugNoTimeout|Mixed Platforms.ActiveCfg = Debug|x86 - {E53AE1B6-5EE8-4B56-B59F-0E7370C8B886}.DebugNoTimeout|Mixed Platforms.Build.0 = Debug|x86 - {E53AE1B6-5EE8-4B56-B59F-0E7370C8B886}.DebugNoTimeout|x86.ActiveCfg = Debug|x86 - {E53AE1B6-5EE8-4B56-B59F-0E7370C8B886}.DebugNoTimeout|x86.Build.0 = Debug|x86 {E53AE1B6-5EE8-4B56-B59F-0E7370C8B886}.Release|Any CPU.ActiveCfg = Release|x86 {E53AE1B6-5EE8-4B56-B59F-0E7370C8B886}.Release|Mixed Platforms.ActiveCfg = Release|x86 {E53AE1B6-5EE8-4B56-B59F-0E7370C8B886}.Release|Mixed Platforms.Build.0 = Release|x86 diff --git a/Renci.SshClient/Renci.SshClient/SshBaseClient.cs b/Renci.SshClient/Renci.SshClient/BaseClient.cs similarity index 90% rename from Renci.SshClient/Renci.SshClient/SshBaseClient.cs rename to Renci.SshClient/Renci.SshClient/BaseClient.cs index 7db5ebc2..475bb895 100644 --- a/Renci.SshClient/Renci.SshClient/SshBaseClient.cs +++ b/Renci.SshClient/Renci.SshClient/BaseClient.cs @@ -10,7 +10,10 @@ using System.Threading; namespace Renci.SshClient { - public abstract class SshBaseClient : IDisposable + /// + /// Serves as base class for client implementations, provides common client functionality. + /// + public abstract class BaseClient : IDisposable { private TimeSpan _keepAliveInterval; @@ -74,10 +77,10 @@ namespace Renci.SshClient public event EventHandler Authenticating; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The connection info. - public SshBaseClient(ConnectionInfo connectionInfo) + public BaseClient(ConnectionInfo connectionInfo) { this.ConnectionInfo = connectionInfo; this.Session = new Session(connectionInfo); @@ -206,7 +209,7 @@ namespace Renci.SshClient } } - ~SshBaseClient() + ~BaseClient() { // Do not re-create Dispose clean-up code here. // Calling Dispose(false) is optimal in terms of diff --git a/Renci.SshClient/Renci.SshClient/Documentation/Content/Extensibility.AddAuthenticationMethod.aml b/Renci.SshClient/Renci.SshClient/Documentation/Content/Extensibility.AddAuthenticationMethod.aml new file mode 100644 index 00000000..0b213804 --- /dev/null +++ b/Renci.SshClient/Renci.SshClient/Documentation/Content/Extensibility.AddAuthenticationMethod.aml @@ -0,0 +1,96 @@ + + + + + + + + Required introduction + + + + + Procedure title + + + + First step + + + + + Second step + + + + + + +
+ Optional section title + + + Procedure #2 + + + + First step + + + + + Second step + + + + + + +
+ + + + +
+
\ No newline at end of file diff --git a/Renci.SshClient/Renci.SshClient/Documentation/Content/Extensibility.AddEncryption.aml b/Renci.SshClient/Renci.SshClient/Documentation/Content/Extensibility.AddEncryption.aml new file mode 100644 index 00000000..83e3d974 --- /dev/null +++ b/Renci.SshClient/Renci.SshClient/Documentation/Content/Extensibility.AddEncryption.aml @@ -0,0 +1,96 @@ + + + + + + + + Required introduction + + + + + Procedure title + + + + First step + + + + + Second step + + + + + + +
+ Optional section title + + + Procedure #2 + + + + First step + + + + + Second step + + + + + + +
+ + + + +
+
\ No newline at end of file diff --git a/Renci.SshClient/Renci.SshClient/Documentation/Content/Extensibility.AddHashAlgorithm.aml b/Renci.SshClient/Renci.SshClient/Documentation/Content/Extensibility.AddHashAlgorithm.aml new file mode 100644 index 00000000..90218463 --- /dev/null +++ b/Renci.SshClient/Renci.SshClient/Documentation/Content/Extensibility.AddHashAlgorithm.aml @@ -0,0 +1,96 @@ + + + + + + + + Required introduction + + + + + Procedure title + + + + First step + + + + + Second step + + + + + + +
+ Optional section title + + + Procedure #2 + + + + First step + + + + + Second step + + + + + + +
+ + + + +
+
\ No newline at end of file diff --git a/Renci.SshClient/Renci.SshClient/Documentation/Content/Extensibility.aml b/Renci.SshClient/Renci.SshClient/Documentation/Content/Extensibility.aml new file mode 100644 index 00000000..6377bdce --- /dev/null +++ b/Renci.SshClient/Renci.SshClient/Documentation/Content/Extensibility.aml @@ -0,0 +1,21 @@ + + + + + + Required introduction + + + + "In This Section" info + + + + + + + \ No newline at end of file diff --git a/Renci.SshClient/Renci.SshClient/Documentation/Content/HowTo.Connect.aml b/Renci.SshClient/Renci.SshClient/Documentation/Content/HowTo.Connect.aml new file mode 100644 index 00000000..eef4b7b7 --- /dev/null +++ b/Renci.SshClient/Renci.SshClient/Documentation/Content/HowTo.Connect.aml @@ -0,0 +1,157 @@ + + + + + + The library supports differnet method to connect to SSH server. + It also has support to add a custom authentication method if needed. Method supported out of the box are :publickey, password and keyboard-interactive. There is also support for different events that can occure during authentication. For example: server can send an information that need to be presented to the user upon login, user's password is expired and new password could be provided to change user's password and others scenrios. + + By using T:Renci.SshClient.ConnectionInfo you can specify connection timeout, which in this case will wait 30 seconds while tying to connect to the server after which it will throw an exception if it did not connect. + + + +
+ Connect using password. + + Following examples show how to connect using username and password combination. + + + + Connecting using username to server's default port + + using (var client = new SshClient("host", "username", "password")) + { + client.Connect(); + client.Disconnect(); + } + + + + Connecting using username to server's port 1234 + + using (var client = new SshClient("host", 1234, "username", "password")) + { + client.Connect(); + client.Disconnect(); + } + + + + + This is similar to previouse example but it uses T:Renci.SshClient.ConnectionInfo objet to provide connection information. + + + var connectionInfo = new PasswordConnectionInfo("host", "username", "password"); + using (var client = new SshClient(connectionInfo)) + { + client.Connect(); + client.Disconnect(); + } + + + + Try to connect to the host within 30 seconds. + + var connectionInfo = new PasswordConnectionInfo("host", "username", "password"); + connectionInfo.Timeout = TimeSpan.FromSeconds(30); + using (var client = new SshClient(connectionInfo)) + { + client.Connect(); + client.Disconnect(); + } + + + + + +
+ +
+ Connect using private key file. + + Following examples show how to connect using one or many private keys wich can be encrypted with passphrase. + + + + Connecting using private key file without providing a passphrase + + using (var client = new SshClient("host", "username", new PrivateKeyFile(File.OpenRead(@"private.key")))) + { + client.Connect(); + client.Disconnect(); + } + + + + Connecting using private key file without providing a passphrase + + using (var client = new SshClient("host", "username", new PrivateKeyFile(File.OpenRead(@"private.key")))) + { + client.Connect(); + client.Disconnect(); + } + + + + + +
+ +
+ Connect using keyboar interactive method. + + Examples of how to use keyboard interactive method to authenticate users. + + + + Example description + + + + + + +
+ +
+ Display server propmt to the user. + + Description + + + + Example description + + + + + + +
+ +
+ Change user password when logging in. + + Description + + + + Example description + + + + + + +
+ + + + T:Renci.SshClient.PrivateKeyConnectionInfo + T:Renci.SshClient.PasswordConnectionInfo + T:Renci.SshClient.SshClient + M:Renci.SshClient.SshBaseClient.Connect + + +
+
\ No newline at end of file diff --git a/Renci.SshClient/Renci.SshClient/Documentation/Content/HowTo.Sftp.aml b/Renci.SshClient/Renci.SshClient/Documentation/Content/HowTo.Sftp.aml new file mode 100644 index 00000000..d84d16c4 --- /dev/null +++ b/Renci.SshClient/Renci.SshClient/Documentation/Content/HowTo.Sftp.aml @@ -0,0 +1,50 @@ + + + + + + Required introduction + + + + + + + + + + \ No newline at end of file diff --git a/Renci.SshClient/Renci.SshClient/Documentation/Content/HowTo.SshCommand.Run.aml b/Renci.SshClient/Renci.SshClient/Documentation/Content/HowTo.SshCommand.Run.aml new file mode 100644 index 00000000..22fd4e42 --- /dev/null +++ b/Renci.SshClient/Renci.SshClient/Documentation/Content/HowTo.SshCommand.Run.aml @@ -0,0 +1,68 @@ + + + + + Optional summary abstract + + + Required introduction + + + + Procedure title + + + + First step + + + + + Second step + + + + Optional conclusion + + Optional code example + + Optional discussion of error handling and other + issues related to writing solid code. + Optional discussion of security issues. + + + + + \ No newline at end of file diff --git a/Renci.SshClient/Renci.SshClient/Documentation/Content/HowTo.SshCommand.aml b/Renci.SshClient/Renci.SshClient/Documentation/Content/HowTo.SshCommand.aml new file mode 100644 index 00000000..276d75c2 --- /dev/null +++ b/Renci.SshClient/Renci.SshClient/Documentation/Content/HowTo.SshCommand.aml @@ -0,0 +1,50 @@ + + + + + + Required introduction + + + + + + + + + + \ No newline at end of file diff --git a/Renci.SshClient/Renci.SshClient/Documentation/Content/HowTo.aml b/Renci.SshClient/Renci.SshClient/Documentation/Content/HowTo.aml new file mode 100644 index 00000000..0b1008d5 --- /dev/null +++ b/Renci.SshClient/Renci.SshClient/Documentation/Content/HowTo.aml @@ -0,0 +1,50 @@ + + + + + + Required introduction + + + + + + + + + + \ No newline at end of file diff --git a/Renci.SshClient/Renci.SshClient/Documentation/Content/Introduction.aml b/Renci.SshClient/Renci.SshClient/Documentation/Content/Introduction.aml new file mode 100644 index 00000000..e7baf7c1 --- /dev/null +++ b/Renci.SshClient/Renci.SshClient/Documentation/Content/Introduction.aml @@ -0,0 +1,48 @@ + + + + + Optional summary abstract + + + Required introduction + + Optional description of content in this section + + + Optional external resources section + + + + + \ No newline at end of file diff --git a/Renci.SshClient/Renci.SshClient/Documentation/Content/Reference.aml b/Renci.SshClient/Renci.SshClient/Documentation/Content/Reference.aml new file mode 100644 index 00000000..47a38e3f --- /dev/null +++ b/Renci.SshClient/Renci.SshClient/Documentation/Content/Reference.aml @@ -0,0 +1,16 @@ + + + + + + Assembly name + + + + API member ID + + + + \ No newline at end of file diff --git a/Renci.SshClient/Renci.SshClient/Documentation/Renci.SshClient.content b/Renci.SshClient/Renci.SshClient/Documentation/Renci.SshClient.content new file mode 100644 index 00000000..c16bbc1f --- /dev/null +++ b/Renci.SshClient/Renci.SshClient/Documentation/Renci.SshClient.content @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Renci.SshClient/Renci.SshClient/Documentation/SshClient.shfbproj b/Renci.SshClient/Renci.SshClient/Documentation/SshClient.shfbproj new file mode 100644 index 00000000..b701f435 --- /dev/null +++ b/Renci.SshClient/Renci.SshClient/Documentation/SshClient.shfbproj @@ -0,0 +1,133 @@ + + + + Debug + AnyCPU + 2.0 + {0b73772a-c19f-4218-bd92-efa8d5f2ddd3} + 1.9.0.0 + + Documentation + Documentation + Documentation + + .\Help\ + SshClient + en-US + + + + 4.0.30319 + A Ssh.Net Client Documentation + olegkap%40gmail.com + http://sshnet.codeplex.com + Summary, Parameter, Returns, AutoDocumentCtors, Namespace, TypeParameter + + + + +{@CachedFrameworkCommentList} +{@CommentFileList} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Renci.SshClient/Renci.SshClient/Renci.SshClient.csproj b/Renci.SshClient/Renci.SshClient/Renci.SshClient.csproj index 19b570d1..1c76640e 100644 --- a/Renci.SshClient/Renci.SshClient/Renci.SshClient.csproj +++ b/Renci.SshClient/Renci.SshClient/Renci.SshClient.csproj @@ -25,6 +25,7 @@ DEBUG;TRACE prompt 4 + bin\Debug\Renci.SshClient.XML pdbonly @@ -33,6 +34,7 @@ TRACE prompt 4 + bin\Release\Renci.SshClient.XML true @@ -49,6 +51,7 @@ false ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules false + bin\DebugNoTimeout\Renci.SshClient.XML @@ -131,7 +134,7 @@ - + @@ -274,6 +277,22 @@ + + + + + + + + + + + + + + + +