I am able to define the proxy server by using the WinSCP GUI. If I do this I am able to connect to a remote host. But in code I don\'t find a way to declare the proxy server
Use the SessionOptions.AddRawSettings to configure raw session settings appropriate for your kind of proxy.
For example:
sessionOptions.AddRawSettings("ProxyMethod", "3");
sessionOptions.AddRawSettings("ProxyHost", "proxy");
See a full list of raw sessions settings.
Though a way easier is to configure the proxy in WinSCP GUI and have it generate a code template for you.