Remove delete files

This commit is contained in:
olegkap_cp
2013-01-08 16:07:12 +00:00
parent 6d2604948d
commit b629a4f344
5 changed files with 0 additions and 212 deletions
@@ -1,44 +0,0 @@
using Renci.SshNet.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Renci.SshNet.Examples
{
class PasswordConnectionInfoExamples
{
private void Example()
{
#region ConnectUsingPasswordConnectionInfo
var connectionInfo = new PasswordConnectionInfo("host", "username", "password");
using (var client = new SftpClient(connectionInfo))
{
client.Connect();
// Do something here
client.Disconnect();
}
#endregion
}
private void Example1()
{
#region ChangePasswordWhenConnecting
var connectionInfo = new PasswordConnectionInfo("host", "username", "password");
var encoding = new Renci.SshNet.Common.ASCIIEncoding();
connectionInfo.PasswordExpired += delegate(object sender, AuthenticationPasswordChangeEventArgs e)
{
e.NewPassword = encoding.GetBytes("123456");
};
using (var client = new SshClient(connectionInfo))
{
client.Connect();
client.Disconnect();
}
#endregion
}
}
}
@@ -1,23 +0,0 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace Renci.SshNet.Examples
{
class PrivateKeyConnectionInfoExample
{
private void Example()
{
#region ConnectUsingPrivateKeyConnectionInfo
var connectionInfo = new PrivateKeyConnectionInfo("host", 1234, "username", new PrivateKeyFile(File.OpenRead(@"rsa_pass_key.txt"), "tester"));
using (var client = new SshClient(connectionInfo))
{
client.Connect();
client.Disconnect();
}
#endregion
}
}
}
@@ -1,42 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Renci.SshNet.Examples
{
class PrivateKeyFileExample
{
#region RSAKeyExample
private string _privateRSAKey = @"
-----BEGIN RSA PRIVATE KEY-----
MIIEoQIBAAKCAQEAuTtXn+BatX1oJuvhqfJZw5jc/pcIxJUPmuoFCH3+bXfKBJ/9
4ixNETzZBasyvT/ozboAbCG3qcJOYxf2BEeTAIXe1jLAoTd1GKCwMvZOyjnsPN95
/lChwfdnBbMzpZYTGfoUylXme/mzjjLu/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wk30en8CgYAyuPzNCfGdm00lMZ8JPH7pTwaBDq4xdrDM9FgHUCna
E0FlXP0uTgT2J6nSQKijtPI75JadfhgvL1E+vTLmX2wViBU45XvcrlZ92Vlr0nBL
wbgnUB1otIzauyD49AuIsFegxSWcZ8QCJmKIMlouir0X1FyR3Apfzv6Qfio+kyNH
vwKBgQCtwxojkzUSfV3zDt6bYSLBzgXgo/Zr9lS+gSggP72DzINmW2gbA0fkM2Zu
JltcfakKv4gVX/1zooz+7t+4bj6dqt+bl7hYz0VnTSDZGuo5LKDif/4gSGrdblC2
QLTuX2HjWCZdsue7mRwL7cXR4zlIoE99+Ryhdxvc5wHSfYr/JA==
-----END RSA PRIVATE KEY-----
";
#endregion
}
}
@@ -1,40 +0,0 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace Renci.SshNet.Examples
{
class SshClientExamples
{
private void Example()
{
#region CreateSshClientWithUsernamePassword
using (var client = new SshClient("host", "username", "password"))
{
client.Connect();
// Do something here
client.Disconnect();
}
#endregion
#region ConnectUsingPrivateKey
using (var client = new SshClient("host", "username", new PrivateKeyFile(File.OpenRead(@"private.key"))))
{
client.Connect();
client.Disconnect();
}
#endregion
#region ConnectUsingPrivateKeyAndPassphrase
using (var client = new SshClient("host", "username", new PrivateKeyFile(File.OpenRead(@"private.key"), "passphrase")))
{
client.Connect();
client.Disconnect();
}
#endregion
}
}
}
@@ -1,63 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
namespace Renci.SshNet.Examples
{
class SshCommandExamples
{
public void Example()
{
#region Example1
using (var client = new SshClient("host1", "username", "password"))
{
client.Connect();
var cmd = client.CreateCommand("sleep 30s;date"); // Perform long running task
var asynch = cmd.BeginExecute(null, null);
while (!asynch.IsCompleted)
{
Console.WriteLine("Waiting for command to complete...");
Thread.Sleep(2000);
}
cmd.EndExecute(asynch);
client.Disconnect();
}
#endregion
#region Example2
using (var client = new SshClient("host2", "username", "password"))
{
client.Connect();
var cmd = client.CreateCommand("sleep 30s;date"); // Perform long running task
var asynch = cmd.BeginExecute(null, null);
while (!asynch.IsCompleted)
{
Console.WriteLine("Waiting for command to complete...");
Thread.Sleep(2000);
}
cmd.EndExecute(asynch);
client.Disconnect();
}
#endregion
#region Example3
using (var client = new SshClient("host3", "username", "password"))
{
client.Connect();
var cmd = client.CreateCommand("sleep 30s;date"); // Perform long running task
var asynch = cmd.BeginExecute(null, null);
while (!asynch.IsCompleted)
{
Console.WriteLine("Waiting for command to complete...");
Thread.Sleep(2000);
}
cmd.EndExecute(asynch);
client.Disconnect();
}
#endregion
}
}
}