Quantcast
Channel: sshnet Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1729

New Post: Simple .cshtml example?

$
0
0
I got this to work by doing this:
@using Renci;
@using Renci.SshNet;
@using Renci.SshNet.NetConf;
@using Renci.SshNet.Common;
@using Renci.SshNet.Channels;
@using Renci.SshNet.Compression;
@using Renci.SshNet.Sftp;
@using Renci.SshNet.Security;
@using Renci.SshNet.Messages;

@{
    
var RemoteHost = "server";
var RemoteUserName = "user";
var RemotePassWord = "password";

var connectionInfo = new PasswordConnectionInfo(RemoteHost, RemoteUserName, RemotePassWord); 
var ssh = new SshClient(connectionInfo);
ssh.Connect();
var terminal = ssh.RunCommand("ls -l");

Response.Write(terminal.Result);
}

Viewing all articles
Browse latest Browse all 1729

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>