<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="/rss.xsl"?><rss version="2.0"><channel><title>sshnet Discussions Rss Feed</title><link>http://sshnet.codeplex.com/Thread/List.aspx</link><description>sshnet Discussions Rss Description</description><item><title>New Post: ExpectAction Problem</title><link>http://sshnet.codeplex.com/discussions/444195</link><description>&lt;div style="line-height: normal;"&gt;Is it correct to assume that only two &amp;quot;choice&amp;quot; can be used in an ExpectAction?&lt;br /&gt;
&lt;br /&gt;
I'm trying to issue a traceroute command on a cisco router without the host specified. This causes the CLI to ask for additional information, including target and source host. A total of 10 questions are asked before the command is successfully executed.&lt;br /&gt;
&lt;br /&gt;
I thought I could just chain ExpectActions as so:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt; ss.Expect(
                            new ExpectAction(@&amp;quot;Protocol \[ip\]: &amp;quot;, (s) =&amp;gt;
                                {
                                    ss.WriteLine(&amp;quot;ip&amp;quot;);
                                    _reply += s;
                                }),
                            new ExpectAction(@&amp;quot;Target IP address: &amp;quot;, (s) =&amp;gt;
                                {
                                    ss.WriteLine(dIpAddress);
                                    _reply += s;
                                }),
                            new ExpectAction(@&amp;quot;Source address: &amp;quot;, (s) =&amp;gt;
                                {
                                    ss.WriteLine(sIpAddress);
                                    _reply += s;
                                }),
                            new ExpectAction(@&amp;quot;Numeric display \[n\]: &amp;quot;, (s) =&amp;gt;
                                {
                                    ss.WriteLine(&amp;quot;n&amp;quot;);
                                    _reply += s;
                                }),
                            new ExpectAction(@&amp;quot;Timeout in seconds [3]: &amp;quot;, (s) =&amp;gt;
                                {
                                    ss.WriteLine(&amp;quot;3&amp;quot;);
                                    _reply += s;
                                }),
                            new ExpectAction(@&amp;quot;Probe count [3]: &amp;quot;, (s) =&amp;gt;
                                {
                                    ss.WriteLine(&amp;quot;3&amp;quot;);
                                    _reply += s;
                                }),
                            new ExpectAction(@&amp;quot;Minimum Time to Live [1]: &amp;quot;, (s) =&amp;gt;
                                {
                                    ss.WriteLine(&amp;quot;1&amp;quot;);
                                    _reply += s;
                                }),
                            new ExpectAction(@&amp;quot;Maximum Time to Live [30]: &amp;quot;, (s) =&amp;gt;
                                {
                                    ss.WriteLine(&amp;quot;30&amp;quot;);
                                    _reply += s;
                                }),
                            new ExpectAction(@&amp;quot;Port Number [33434]: &amp;quot;, (s) =&amp;gt;
                                {
                                    ss.WriteLine(&amp;quot;33434&amp;quot;);
                                    _reply += s;
                                }),
                            new ExpectAction(@&amp;quot;Loose, Strict, Record, Timestamp, Verbose[none]: &amp;quot;, (s) =&amp;gt;
                                {
                                    ss.WriteLine(&amp;quot; &amp;quot;);
                                    _reply += s;
                                }),
                            new ExpectAction(new Regex(@&amp;quot;\\*  \\*  \\*&amp;quot;), (s) =&amp;gt;
                                {
                                    _reply = s;
                                    _reply += s;
                                })
                            );&lt;/code&gt;&lt;/pre&gt;

However, only the first two are ever processed.&lt;br /&gt;
&lt;br /&gt;
I assume I'm doing this wrong. I appreciate any input.&lt;br /&gt;
&lt;/div&gt;</description><author>jimmychanga</author><pubDate>Sun, 19 May 2013 14:28:55 GMT</pubDate><guid isPermaLink="false">New Post: ExpectAction Problem 20130519022855P</guid></item><item><title>New Post: Zlib compression support</title><link>http://sshnet.codeplex.com/discussions/443647</link><description>&lt;div style="line-height: normal;"&gt;I followed the last comment mentioned in &lt;a href="https://sshnet.codeplex.com/workitem/219" rel="nofollow"&gt;Issue 219&lt;/a&gt;, and I am able to get zlib compression working.   Thanks olegkap!  By the way, in addition to uncommenting lines in Zlibstream.cs, I also have to update variable CompressionAlgorithms in ConnectionInfo.cs.&lt;br /&gt;
&lt;/div&gt;</description><author>tony1</author><pubDate>Thu, 16 May 2013 21:38:13 GMT</pubDate><guid isPermaLink="false">New Post: Zlib compression support 20130516093813P</guid></item><item><title>New Post: Strong name</title><link>http://sshnet.codeplex.com/discussions/285587</link><description>&lt;div style="line-height: normal;"&gt;I also want to use the assembly referenced from an assembly that is signed. I'd like to put in a request for you to sign the released assemblies. It allows people like us to download the binary as is and not have to keep a copy of the source code that we build ourselves. Thanks.&lt;br /&gt;
&lt;/div&gt;</description><author>Sacrilege</author><pubDate>Wed, 15 May 2013 18:00:22 GMT</pubDate><guid isPermaLink="false">New Post: Strong name 20130515060022P</guid></item><item><title>New Post: Zlib compression support</title><link>http://sshnet.codeplex.com/discussions/443647</link><description>&lt;div style="line-height: normal;"&gt;Will SSH.NET support Zlib compression anytime soon?  A SFTP server that I connect to require Zlib compression and SSH.NET gives error &amp;quot;Compression algorithm not found.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Is there a way for client to tell server disabling compression for the connection?&lt;br /&gt;
&lt;br /&gt;
I would be happy to try out if there is an alpha version available.  Thanks.&lt;br /&gt;
&lt;/div&gt;</description><author>tony1</author><pubDate>Tue, 14 May 2013 21:11:14 GMT</pubDate><guid isPermaLink="false">New Post: Zlib compression support 20130514091114P</guid></item><item><title>New Post: SftpClient.Exists and SftpClient.DownloadFile CREATE a file on server if file does not exist</title><link>http://sshnet.codeplex.com/discussions/403235</link><description>&lt;div style="line-height: normal;"&gt;I managed to get it to work last night. In my case, for some reason, when using the pre-compiled .dll downloaded from here, it wasn't working. I ended up removing the reference to the DLL and re-referenced it to the project instead. Hoping that I could troubleshoot further with the project loaded.  Once I re-compiled everything, the Exists() function works now. &lt;br /&gt;
&lt;/div&gt;</description><author>trike007</author><pubDate>Tue, 14 May 2013 15:32:49 GMT</pubDate><guid isPermaLink="false">New Post: SftpClient.Exists and SftpClient.DownloadFile CREATE a file on server if file does not exist 20130514033249P</guid></item><item><title>New Post: SftpClient.Exists and SftpClient.DownloadFile CREATE a file on server if file does not exist</title><link>http://sshnet.codeplex.com/discussions/403235</link><description>&lt;div style="line-height: normal;"&gt;We just don't call Exists(). Get() or DownloadFile() seem to work as expected.&lt;br /&gt;
&lt;/div&gt;</description><author>dwynne</author><pubDate>Tue, 14 May 2013 15:27:29 GMT</pubDate><guid isPermaLink="false">New Post: SftpClient.Exists and SftpClient.DownloadFile CREATE a file on server if file does not exist 20130514032729P</guid></item><item><title>New Post: SftpClient.Exists and SftpClient.DownloadFile CREATE a file on server if file does not exist</title><link>http://sshnet.codeplex.com/discussions/403235</link><description>&lt;div style="line-height: normal;"&gt;Did you happen to resolve this? I'm having the same problem with the exists method. It always returns true, and changing directory into an invalid path doesn't throw an exception either.&lt;br /&gt;
&lt;br /&gt;
I'm also using sysax multi server.&lt;br /&gt;
&lt;/div&gt;</description><author>trike007</author><pubDate>Tue, 14 May 2013 01:37:46 GMT</pubDate><guid isPermaLink="false">New Post: SftpClient.Exists and SftpClient.DownloadFile CREATE a file on server if file does not exist 20130514013746A</guid></item><item><title>New Post: Problem with Library ssh.net</title><link>http://sshnet.codeplex.com/discussions/443459</link><description>&lt;div style="line-height: normal;"&gt;hi every body&lt;br /&gt;
 &lt;br /&gt;
I'm using this library to connect to the Linux commands I run and run but&lt;br /&gt;
Some commands have problems&lt;br /&gt;
 &lt;br /&gt;
For example, I have a problem running these commands:&lt;br /&gt;
 &lt;br /&gt;
top and top -n 1&lt;br /&gt;
 &lt;br /&gt;
error:TERM environment variable not set.&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
 private void button2_Click(object sender, EventArgs e)
        {
            Renci.SshNet.SshClient sshClient = new Renci.SshNet.SshClient(&amp;quot;192.168.150.128&amp;quot;, &amp;quot;reza&amp;quot;, &amp;quot;1&amp;quot;);
            sshClient.Connect();
            var command = sshClient.RunCommand(&amp;quot;top&amp;quot;);
 
            var line = command.Result.Split('\n');
            List&amp;lt;ServerStatusCpu&amp;gt; serverstatus = new List&amp;lt;ServerStatusCpu&amp;gt;();
            for (int i = 3; i &amp;lt; line.Length - 1; i++)
            {
                var li = line[i];
                var words = li.Split(' ');
                List&amp;lt;string&amp;gt; fillterwords = new List&amp;lt;string&amp;gt;();
 
                foreach (var w in words)
                {
                    if (w != &amp;quot;&amp;quot;)
                    {
                        fillterwords.Add(w);
                    }
                }
 
                ServerStatusCpu serverStatus = new ServerStatusCpu();
                serverStatus.Time = fillterwords[0];
                serverStatus.TimeType = fillterwords[1];
                serverStatus.Name = fillterwords[2];
                serverStatus.UserCpuTime = float.Parse(fillterwords[3].Replace(&amp;quot;%&amp;quot;, &amp;quot;&amp;quot;));
                serverStatus.UserNiceCpuTime = float.Parse(fillterwords[4].Replace(&amp;quot;%&amp;quot;, &amp;quot;&amp;quot;));
                serverStatus.SystemCpuTime = float.Parse(fillterwords[5].Replace(&amp;quot;%&amp;quot;, &amp;quot;&amp;quot;));
                serverStatus.IoWaitCpuTime = float.Parse(fillterwords[6].Replace(&amp;quot;%&amp;quot;, &amp;quot;&amp;quot;));
                serverStatus.IrqCpuTime = float.Parse(fillterwords[7].Replace(&amp;quot;%&amp;quot;, &amp;quot;&amp;quot;));
                serverStatus.SoftwareIrqCpuTime = float.Parse(fillterwords[8].Replace(&amp;quot;%&amp;quot;, &amp;quot;&amp;quot;));
                serverStatus.StealCpuTime = float.Parse(fillterwords[9].Replace(&amp;quot;%&amp;quot;, &amp;quot;&amp;quot;));
                serverStatus.GuestCpuTime = float.Parse(fillterwords[10].Replace(&amp;quot;%&amp;quot;, &amp;quot;&amp;quot;));
                serverStatus.IdleCpuTime = float.Parse(fillterwords[11].Replace(&amp;quot;%&amp;quot;, &amp;quot;&amp;quot;));
 
                serverstatus.Add(serverStatus);
            }
 
            dataGridView1.DataSource = serverstatus;
        }

class ServerStatusCpu

&lt;/code&gt;&lt;/pre&gt;

public class ServerStatusCpu&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;{
    public string Time { get; set; }

    public string TimeType { get; set; }

    public string Name { get; set; }

    public float UserCpuTime { get; set; }

    public float SystemCpuTime { get; set; }

    public float UserNiceCpuTime { get; set; }

    public float IdleCpuTime { get; set; }

    public float IoWaitCpuTime { get; set; }

    public float IrqCpuTime { get; set; }

    public float SoftwareIrqCpuTime { get; set; }

    public float StealCpuTime { get; set; }

    public float GuestCpuTime { get; set; }
}&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;</description><author>post98</author><pubDate>Mon, 13 May 2013 12:33:44 GMT</pubDate><guid isPermaLink="false">New Post: Problem with Library ssh.net 20130513123344P</guid></item><item><title>New Post: SFTP: Uploading Files to the FTP Server has Inconsistent Behavior</title><link>http://sshnet.codeplex.com/discussions/439055</link><description>&lt;div style="line-height: normal;"&gt;Im trying to upload file from my local to unix platform using sftp...any suggestions?? is this powershell script ???? &lt;br /&gt;
&lt;/div&gt;</description><author>svivek400</author><pubDate>Mon, 13 May 2013 11:52:23 GMT</pubDate><guid isPermaLink="false">New Post: SFTP: Uploading Files to the FTP Server has Inconsistent Behavior 20130513115223A</guid></item><item><title>New Post: Windows RT and signing</title><link>http://sshnet.codeplex.com/discussions/401592</link><description>&lt;div style="line-height: normal;"&gt;Unfortunately the library does not Support WinRT for now... I heard of guys who already ported it to WinRT but as you need to do really much low Level work with e.g. the new StreamSocket, that won't go public that soon i guess...&lt;br /&gt;
&lt;br /&gt;
edit: stumbled over this via Google - didn't recognize the date&lt;br /&gt;
&lt;/div&gt;</description><author>ankoh</author><pubDate>Fri, 10 May 2013 09:51:15 GMT</pubDate><guid isPermaLink="false">New Post: Windows RT and signing 20130510095115A</guid></item><item><title>New Post: No such File or Directory</title><link>http://sshnet.codeplex.com/discussions/442954</link><description>&lt;div style="line-height: normal;"&gt;Yes.  In the ScpClient itself.&lt;br /&gt;
&lt;/div&gt;</description><author>jimtal001</author><pubDate>Thu, 09 May 2013 15:29:09 GMT</pubDate><guid isPermaLink="false">New Post: No such File or Directory 20130509032909P</guid></item><item><title>New Post: No such File or Directory</title><link>http://sshnet.codeplex.com/discussions/442954</link><description>&lt;div style="line-height: normal;"&gt;This is in ScpClient itself? So it is a bug in ScpClient? Any chance that's finding its way back into the master/trunk, much less NuGet package? Thank ye!&lt;br /&gt;
&lt;/div&gt;</description><author>mwpowellhtx</author><pubDate>Thu, 09 May 2013 13:45:02 GMT</pubDate><guid isPermaLink="false">New Post: No such File or Directory 20130509014502P</guid></item><item><title>New Post: No such File or Directory</title><link>http://sshnet.codeplex.com/discussions/442954</link><description>&lt;div style="line-height: normal;"&gt;My file upload issue was finally resolved by adding the modified Upload method (redled, Feb 7, 2012) to the ScpClient.cs:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;    public void Upload_2(FileInfo fileInfo, string filePath)
    {
        using (var input = new PipeStream())
        using (var channel = this.Session.CreateChannel&amp;lt;ChannelSession&amp;gt;())
        {
            channel.DataReceived += delegate(object sender, Common.ChannelDataEventArgs e)
            {
                input.Write(e.Data, 0, e.Data.Length);
                input.Flush();
            };

            channel.Open();

            //  Send channel command request
            string directoryPath = filePath.Substring(0, filePath.LastIndexOf('/') + 1);
            string filename = filePath.Substring(filePath.LastIndexOf('/') + 1);

            if (String.IsNullOrEmpty(directoryPath))
                channel.SendExecRequest(string.Format(&amp;quot;scp -qt {0}&amp;quot;, filename));
            else
                channel.SendExecRequest(string.Format(&amp;quot;cd {0};&amp;quot;, directoryPath) + string.Format(&amp;quot;scp -qt {0}&amp;quot;, filename));
            this.CheckReturnCode(input);

            this.InternalUpload(channel, input, fileInfo, filename);

            channel.Close();
        }
    }&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;</description><author>jimtal001</author><pubDate>Thu, 09 May 2013 13:36:01 GMT</pubDate><guid isPermaLink="false">New Post: No such File or Directory 20130509013601P</guid></item><item><title>New Post: No such File or Directory</title><link>http://sshnet.codeplex.com/discussions/442954</link><description>&lt;div style="line-height: normal;"&gt;May be helpful, I ran an experiment with &amp;quot;local.txt&amp;quot; instead of &amp;quot;~/local.txt&amp;quot; and wouldn't you know it, I got the file transferred! Yay!&lt;br /&gt;
&lt;br /&gt;
However, I would expect anything after the &amp;quot;:&amp;quot; in a typical Scp command would be fair game for Download remote file name, but who knew?&lt;br /&gt;
&lt;br /&gt;
Perhaps some documentation around that issue would be a good thing.&lt;br /&gt;
&lt;br /&gt;
HTH&lt;br /&gt;
&lt;br /&gt;
Regards,&lt;br /&gt;
&lt;br /&gt;
Michael Powell&lt;br /&gt;
&lt;/div&gt;</description><author>mwpowellhtx</author><pubDate>Wed, 08 May 2013 22:07:24 GMT</pubDate><guid isPermaLink="false">New Post: No such File or Directory 20130508100724P</guid></item><item><title>New Post: No such File or Directory</title><link>http://sshnet.codeplex.com/discussions/442954</link><description>&lt;div style="line-height: normal;"&gt;Any luck with this one? I too am  finding the library WONDERFUL! THANK YOU! SSH works like a charm. Now I would like to copy a result that I redirected from the SSH command:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;~/command --some_args &amp;gt;~/result.txt&lt;/code&gt;&lt;/pre&gt;

Now via SCP, I say:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;//The Configure and Connected are some extensions I cooked up to help it out by convention.
using (var client = new ScpClient(Host, User, Password).Configure().Connected())
{
  using (var fs = new FileStream(&amp;quot;local.txt&amp;quot;, FileMode.Create, FileAccess.Write, FileShare.Read))
  {
    //TODO: May hook up Downloading event (in fact I am, but for sake of example, the point is moot.
    client.Download(&amp;quot;~/result.txt&amp;quot;, fs);
    //ScpException: scp: ~/result.txt: No such file or directory
  }
}&lt;/code&gt;&lt;/pre&gt;

However, like my colleague here, getting the same issue. It's there! I checked via Ssh. Is there a trick to making the Scp client work?&lt;br /&gt;
&lt;br /&gt;
I could run the following and pick up the file: scp &lt;a href="mailto:root@10.10.0.1:~/result.txt" rel="nofollow"&gt;root@10.10.0.1:~/result.txt&lt;/a&gt; local.txt&lt;br /&gt;
&lt;br /&gt;
Regards,&lt;br /&gt;
&lt;br /&gt;
Michael Powell&lt;br /&gt;
&lt;/div&gt;</description><author>mwpowellhtx</author><pubDate>Wed, 08 May 2013 22:01:21 GMT</pubDate><guid isPermaLink="false">New Post: No such File or Directory 20130508100121P</guid></item><item><title>New Post: key file formats</title><link>http://sshnet.codeplex.com/discussions/349331</link><description>&lt;div style="line-height: normal;"&gt;Any chance support for a public SSH2 key will be included any time soon?&lt;br /&gt;
&lt;/div&gt;</description><author>dahlsailrunner</author><pubDate>Wed, 08 May 2013 15:39:24 GMT</pubDate><guid isPermaLink="false">New Post: key file formats 20130508033924P</guid></item><item><title>New Post: No such File or Directory</title><link>http://sshnet.codeplex.com/discussions/442954</link><description>&lt;div style="line-height: normal;"&gt;Hello,&lt;br /&gt;
&lt;br /&gt;
First I'd like to say that you have a great product here!&lt;br /&gt;
&lt;br /&gt;
I am working with the latest binary (SshNet 4.0 Binary, 2013.4.7) and still get the scp error: &amp;quot;No such File or Directory&amp;quot; when trying to upload a file using the scp client.  My C# code is listed below, but I have tried many variations of of this code based on the forum discussion with the same results.  The target directory on linux &amp;quot;/data&amp;quot; is valid.  Any suggestions would be greatly appreciated.&lt;br /&gt;
&lt;br /&gt;
Thanks&lt;br /&gt;
Jim&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;    private void SCP_Upload_File()
    {
        try
        {
            string file = &amp;quot;C://temp//test.sh&amp;quot;;
            if (!File.Exists(file)) return;

            FileInfo scriptInfo = new FileInfo(file);
            if ( ! scriptInfo.Exists)  return;

            ConnectionInfo connectionInfo = new PasswordConnectionInfo(host, port, user, pw);

            ScpClient scpClient = new ScpClient(connectionInfo);
            scpClient.BufferSize = 8 * 1024;
            scpClient.Connect();

            if (!scpClient.IsConnected)
            {
                return;
            }

            string targetPath = @&amp;quot;/data/test.sh&amp;quot;;
            scpClient.Upload(scriptInfo.OpenRead(), targetPath);
            scpClient.Disconnect();
        }
        catch (Exception e)
        {
            lb_Log.Items.Add(e.Message);
        }
    }&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;</description><author>jimtal001</author><pubDate>Wed, 08 May 2013 13:31:04 GMT</pubDate><guid isPermaLink="false">New Post: No such File or Directory 20130508013104P</guid></item><item><title>New Post: Bad Packet Length Error</title><link>http://sshnet.codeplex.com/discussions/442847</link><description>&lt;div style="line-height: normal;"&gt;Hello everyone and thanks for your help in advance.  Completely new to SSH.Net and had created a project for connecting to an SFTP serverdoing the following:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;Dim sftpclient As New SftpClient(&amp;quot;host&amp;quot;, port, &amp;quot;user&amp;quot;, &amp;quot;password&amp;quot;)&lt;/code&gt;&lt;/pre&gt;

The project worked fine for a few weeks  but then began encountering a bad packet length error.  In researching, I cam across a few articles suggestingencryption wasthe problem:&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://stackoverflow.com/questions/10886665/how-to-resolve-a-bad-packet-length-error-in-ssh-net" rel="nofollow"&gt;http://stackoverflow.com/questions/10886665/how-to-resolve-a-bad-packet-length-error-in-ssh-net&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://sshnet.codeplex.com/discussions/271671" rel="nofollow"&gt;http://sshnet.codeplex.com/discussions/271671&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
but I amso new to this, I really don'tunderstand what I am doing.  Any helpwould be appreciated.&lt;br /&gt;
&lt;/div&gt;</description><author>kmcnet</author><pubDate>Tue, 07 May 2013 18:31:23 GMT</pubDate><guid isPermaLink="false">New Post: Bad Packet Length Error 20130507063123P</guid></item><item><title>New Post: Sharing Download/Upload methods in BaseClient</title><link>http://sshnet.codeplex.com/discussions/442800</link><description>&lt;div style="line-height: normal;"&gt;actually i'm writing a clr for download and upload file through ms sql.&lt;br /&gt;
Both scp and sftp support upload and download. It could be a good approach to write a virtual method for upload and download in BaseClient. So if i like to switch the protocol, i just need to get the base class and execute download/upload method.&lt;br /&gt;
&lt;br /&gt;
right now, i need something like this.&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;Boolean isSftp = (transferProtocol.Value.ToLower() == &amp;quot;sftp&amp;quot;);
            using (Renci.SshNet.BaseClient ssh = isSftp == true ? 
                (new Renci.SshNet.SftpClient(new Renci.SshNet.PasswordConnectionInfo(server.Value, 22, user.Value, password.Value)) as Renci.SshNet.BaseClient) :
                new Renci.SshNet.ScpClient(new Renci.SshNet.PasswordConnectionInfo(server.Value, 22, user.Value, password.Value))
            )
            {
                ssh.Connect();
                //sftp.ChangeDirectory(System.IO.Path.GetDirectoryName(source.Value));
                //if (sftp.Exists(source.Value) == false)
                //    throw new Exception(String.Concat(&amp;quot;File: &amp;quot;, source, &amp;quot; do not exists on the remote server&amp;quot;));
                System.IO.FileStream file = null;
                using (file = System.IO.File.Exists(destination.Value) == false ? System.IO.File.OpenWrite(destination.Value) : System.IO.File.Create(destination.Value))
                {
                    if (isSftp == true)
                        (ssh as Renci.SshNet.SftpClient).DownloadFile(source.Value, file);
                    else
                        (ssh as Renci.SshNet.ScpClient).Download(source.Value, file);
                }
                //delete only if sftp
                if (delete.IsTrue == true &amp;amp;&amp;amp; isSftp == true)
                    (ssh as Renci.SshNet.SftpClient).Delete(source.Value);
            }&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;</description><author>roker002</author><pubDate>Tue, 07 May 2013 12:50:30 GMT</pubDate><guid isPermaLink="false">New Post: Sharing Download/Upload methods in BaseClient 20130507125030P</guid></item><item><title>New Post: SCP copy to a specific folder</title><link>http://sshnet.codeplex.com/discussions/284021</link><description>&lt;div style="line-height: normal;"&gt;Hi,&lt;br /&gt;
&lt;br /&gt;
i'm using 2013.1.27 and i try to copy a file from a windows to a linux machine.&lt;br /&gt;
My copy command looks like:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;m_Scp.Upload(fi, sTargetDir + fi.Name);&lt;/code&gt;&lt;/pre&gt;

where sTargetDir is &amp;quot;update/&amp;quot;. My copied file pops up on the linux machine within directory ~/update/update/.&lt;br /&gt;
Looks like a bug.&lt;br /&gt;
&lt;br /&gt;
If i use &amp;quot;./update/&amp;quot; everything works fine.&lt;br /&gt;
&lt;br /&gt;
Thanks - Markus&lt;br /&gt;
&lt;/div&gt;</description><author>MarkusLanglotz</author><pubDate>Tue, 07 May 2013 07:46:06 GMT</pubDate><guid isPermaLink="false">New Post: SCP copy to a specific folder 20130507074606A</guid></item></channel></rss>