Hi,
First of all I want to say that so far I have no experience with the ssh.net Framework.
I want to connect to the server but the following problem (server string is null at line sftp.Connect();) occured and I'm not able to solve it.
Maybe someone can tell me what it could be or what i should check.
Thanks in advance
First of all I want to say that so far I have no experience with the ssh.net Framework.
I want to connect to the server but the following problem (server string is null at line sftp.Connect();) occured and I'm not able to solve it.
Maybe someone can tell me what it could be or what i should check.
Thanks in advance
using (var sftp = new SftpClient("127.0.0.1", 990, "admin", "admin"))
{
string wd=sftp.WorkingDirectory;
string ci = sftp.ConnectionInfo.ToString();
if(!sftp.IsConnected)
sftp.Connect();
string uploadedFileName = @"C:\Users\gat\Desktop\test\MyFile.txt";
string remoteFileName = "test2.txt";
using (var file = File.OpenRead(uploadedFileName))
{
sftp.UploadFile(file, remoteFileName);
}
sftp.Disconnect();
}
}