Hi,
I have a SFTP server that I need to connect to in VB.NET. I will need to be able to transfer files to and from this server within my VB project.
I have this code:
This opens a session on my FTP server. Everything works fine.
However, I wish to create another form that I will also use to communicate with the FTP server.
Here's the thing: I don't want to have the session closed when this form closed, and a new one opened when the second form opens. Instead I want a session to be opened on the first form, and the session to be continued on the second form. Is this possible? This would probably require a way of sharing the code throughout the two forms?
How would I go about doing this?
Thanks
I have a SFTP server that I need to connect to in VB.NET. I will need to be able to transfer files to and from this server within my VB project.
I have this code:
Dim SessionOpts As New WinSCP.SessionOptions SessionOpts.FtpMode = FtpMode.Passive
SessionOpts.FtpSecure = FtpSecure.None
SessionOpts.HostName = "ftpserveraddress"
SessionOpts.PortNumber = "22"
SessionOpts.Protocol = Protocol.Sftp
SessionOpts.UserName = txt_username.Text
SessionOpts.Password = txt_password.Text
SessionOpts.SshHostKeyFingerprint = "ssh-rsa 1024 xx:x:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"
Dim Session As New WinSCP.Session
Session.ExecutablePath = "C:\Tools\WinSCP\WinSCP.exe"
Session.Open(SessionOpts)
This opens a session on my FTP server. Everything works fine.
However, I wish to create another form that I will also use to communicate with the FTP server.
Here's the thing: I don't want to have the session closed when this form closed, and a new one opened when the second form opens. Instead I want a session to be opened on the first form, and the session to be continued on the second form. Is this possible? This would probably require a way of sharing the code throughout the two forms?
How would I go about doing this?
Thanks