Quantcast
Viewing all articles
Browse latest Browse all 1026

Created Unassigned: The requested address is not valid in its context [2798]

Hi,

I am encountering error as stated above. It is encountered upon hitting ```this.client.Connect();``` . Below is the block of code involved, for your reference:

```
public bool Connect() {
bool success = true;
this.ErrorMessage = "";
try
{

//this.client = new Sftp();
this.client = new SftpClient(this.FtpServer, PortNumber, this.UserName, this.Password);
this.client.Connect();//EXCEPTION IS ENCOUNTERED HERE
//this.client.Timeout = getConnectionTimeout();

//if (PortNumber > 0)
//{
// this.client.Connect(this.FtpServer, PortNumber);
//}
//else
// this.client.Connect(this.FtpServer);

//SshPrivateKey privateKey = new SshPrivateKey("key_rsa.pem", this.Password);
//this.client.Login(this.UserName, privateKey);

//this.client.Login(this.UserName, this.Password);
}
catch (Exception ex) {
success = false;
this.ErrorMessage = "SFTP-Connect()|" + ex.Message.ToString();
}
return success;
}
```
By the way, values of __host, port, username, and password__ are:

host = 192.168.70.67
port = 0
username = jamestst
password = thepassword

What have I missed here? Please let me know.

Thank you in advance!

Cheers

Viewing all articles
Browse latest Browse all 1026

Trending Articles