Taka wrote:
lansin@ansintech.com wrote:
Taka wrote:
There is an example (in all sorts of languages) here:
https://winscp.net/eng/docs/library#example
Make sure you add WinSCP as a reference to your project.
do I add winscp.dll as a reference?
thank you
You may be able to do that. Even after doing the following I had to reference the DLL directly in my project because it was saying it could not find the DLL(which was strange because the object browser/intellisense was giving me access to everything in it). You will need to run RegAsm on the DLL, then it will show up under the ".NET" section when you add a reference.
See:
https://winscp.net/eng/docs/library_install
Assuming .NET 4.0, and the WinSCP DLL being located at C:\WinSCP\:
Start -> Run -> %WINDIR%\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe "C:\WinSCP\WinSCP.dll" /codebase /tlb
You will also need the .exe file in the same directory as the .dll. If you get an error saying cannot find EXE, you may need to do something like this:
session.ExecutablePath = "C:\WinSCP\WinSCP.exe"
I setup a windows form sing VB2010 the code looks as follows:
I did register the winscp.dll
But at this point a need some help
how do I open winscp
tell it what options I need
such as ftp name, user name, certificate
I thank you in advance for you help.
leonard, Waltham
Option Explicit On
Option Strict Off
Imports System
Imports System.Data
Imports System.Data.OleDb
Imports System.Data.SqlClient
Imports System.Windows.Forms
Imports Microsoft.VisualBasic
Imports System.Diagnostics.Process
'Imports System.Net.Mail
Imports EASendMail 'ad easendmail namespace
Imports WinSCP
Public Class form1
Public NotInheritable Class SessionOptions
End Class
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
End Sub
Public Sub Open(ByVal sessionOptions As SessionOptions)
End Sub
End Class