private void Sshconnect()
{
try
{
Ssh = new SshExec(pHostIp, pUserName, pPassword);
txtwrite.Text="Connecting to " + pHostIp + "...";
Ssh.Connect();
if (Ssh.Connected)
txtwrite.Text = "Host:" + pHostIp + "...Connected";
else
txtwrite.Text="Host:" + pHostIp + "...is not reachable";
}
catch (Exception ex)
{
txtwrite.Text="Host:" + pHostIp + "...is not reachable";
txtwrite.Text = "Error : " + ex.ToString();
}
}
its my code, getting some error
Session.connect: System.NullReferenceException: Object reference not set to an instance of an object.
at Tamir.SharpSsh.jsch.jce.HMACMD5.update(Byte[] foo, Int32 s, Int32 l)
at Tamir.SharpSsh.jsch.jce.HMACMD5.update(Int32 i)
at Tamir.SharpSsh.jsch.Session.read(Buffer buf)
at Tamir.SharpSsh.jsch.UserAuth.start(Session session)
at Tamir.SharpSsh.jsch.UserAuthNone.start(Session session)
at Tamir.SharpSsh.jsch.Session.connect(Int32 connectTimeout)
at Tamir.SharpSsh.jsch.Session.connect(Int32 connectTimeout)
at Tamir.SharpSsh.jsch.Session.connect()
at Tamir.SharpSsh.SshBase.ConnectSession(Int32 tcpPort)
at Tamir.SharpSsh.SshBase.Connect(Int32 tcpPort)
at Tamir.SharpSsh.SshBase.Connect()
at TrxInventoryReport._Default.Sshconnect() in D:\sripriya\TrxInventoryReport\TrxInventoryReport\Trxreport.aspx.cs:line 163