Tamir.SharpSsh.jsch.Session.setConfig C# (CSharp) Method

setConfig() public method

public setConfig ( Hashtable foo ) : void
foo Hashtable
return void
		public void setConfig(Hashtable foo)
		{
			if(config==null) config=new Hashtable();

			foreach (var key in foo.Keys)
			{
				config.Add(key, foo[key]);
			}
		}
		public void setSocketFactory(SocketFactory foo){ socket_factory=foo;}

Usage Example

Example #1
0
 public void Connect()
 {
     InitVAHInfo();
     try
     {
         JSch jsch = new JSch();
         _ssn = jsch.getSession(_usr, _hip, _hp);
         System.Collections.Hashtable hashConfig = new Hashtable();
         hashConfig.Add("StrictHostKeyChecking", "No");
         _ssn.setConfig(hashConfig);
         jsch.addIdentity(_ppk);
         _ssn.connect();
         if (_ssn.isConnected())
         {
             Console.WriteLine("Log Successfully.");
         }
         else
         {
             Console.WriteLine("Log failed.");
         }
     }
     catch (Tamir.SharpSsh.jsch.JSchException jschex)
     {
         Console.WriteLine(jschex.Message);
     }
     catch (Exception anyex)
     {
         Console.WriteLine(anyex.Message);
     }
 }
All Usage Examples Of Tamir.SharpSsh.jsch.Session::setConfig