I try to add an sshclient in my application, mode password key.
when i add key(ScFileStorage1->Keys->Add(Key);) => error message.
What is the pb please?
a part of my code:
ScSSHClient1 = new TScSSHClient(Owner);
ScFileStorage1 = new TScFileStorage(Owner);
ScSSHClient1->HostName = Item->SubItems->Strings[0];// address
ScSSHClient1->Port = 22;
ScSSHClient1->User = "andromede"; //login
ScSSHClient1->Authentication = atPassword;
ScSSHClient1->Password = "andro[1)ADM"; //psw
TScKey *Key = ScFileStorage1->Keys->FindKey(ScSSHClient1->HostName);
if ((Key == NULL) || (!Key->Ready))
{
Key = new TScKey(NULL);
try {
Key->KeyName = ScSSHClient1->HostName;
ScFileStorage1->Keys->Add(Key);
}
catch (Exception &exception) {
Key->Free();
throw;
}
Best regards