74 lines
3.2 KiB
VB.net
74 lines
3.2 KiB
VB.net
Imports System.Reflection
|
|
|
|
Module Module1
|
|
|
|
Sub Main()
|
|
|
|
Dim sftpasm As Assembly = Assembly.LoadFile("C:\Users\Administrator\Documents\Visual Studio 2010\Projects\puttysrc\SMFTP\bin\Debug\SMFTP.dll")
|
|
If sftpasm IsNot Nothing Then
|
|
Dim t As Type = sftpasm.[GetType]("SMFTP.SFTPClient")
|
|
Dim o As Object = Activator.CreateInstance(t)
|
|
Dim bindings As BindingFlags = BindingFlags.InvokeMethod Or BindingFlags.[Public] Or BindingFlags.Instance
|
|
Dim prms As Object() = Nothing
|
|
|
|
prms = New Object() {"secureftp.navicure.com", "5S3F054P", "LPM2055", "22"}
|
|
Dim bSuccess As Boolean = CBool(t.InvokeMember("Connect", bindings, Nothing, o, prms))
|
|
If bSuccess Then
|
|
prms = New Object() {"out/997"}
|
|
bSuccess = CBool(t.InvokeMember("CmdExec_RemoteDirExists", bindings, Nothing, o, prms))
|
|
End If
|
|
If bSuccess Then
|
|
prms = New Object() {"c:\out", True}
|
|
bSuccess = CBool(t.InvokeMember("CmdExec_LocalDirSet", bindings, Nothing, o, prms))
|
|
End If
|
|
If bSuccess Then
|
|
prms = New Object() {True, "out/997"}
|
|
bSuccess = CBool(t.InvokeMember("CmdExe_MGetDir", bindings, Nothing, o, prms))
|
|
End If
|
|
If bSuccess Then
|
|
prms = New Object() {"in"}
|
|
bSuccess = CBool(t.InvokeMember("CmdExec_RemoteDirSet", bindings, Nothing, o, prms))
|
|
End If
|
|
If bSuccess Then
|
|
prms = New Object() {"c:\out\997", True}
|
|
bSuccess = CBool(t.InvokeMember("CmdExec_LocalDirSet", bindings, Nothing, o, prms))
|
|
End If
|
|
If bSuccess Then
|
|
prms = New Object() {"*.997"}
|
|
bSuccess = CBool(t.InvokeMember("CmdExe_MPutFiles", bindings, Nothing, o, prms))
|
|
End If
|
|
If bSuccess Then
|
|
prms = New Object() {"*.997"}
|
|
bSuccess = CBool(t.InvokeMember("CmdExe_MDelFiles", bindings, Nothing, o, prms))
|
|
End If
|
|
End If
|
|
|
|
' Using client As New SMFTP.SFTPClient()
|
|
' Dim bConnected As Boolean = client.Connect("secureftp.navicure.com", "5S3F054P", "LPM2055")
|
|
' If bConnected Then
|
|
' Dim bSuccess As Boolean = client.CmdExec_RemoteDirExists("out/997")
|
|
' If bSuccess Then
|
|
' bSuccess = client.CmdExec_LocalDirSet("c:\out", True)
|
|
' End If
|
|
' If bSuccess Then
|
|
' bSuccess = client.CmdExe_MGetDir(True, "out/997")
|
|
' End If
|
|
' If bSuccess Then
|
|
' bSuccess = client.CmdExec_RemoteDirSet("in")
|
|
' End If
|
|
' If bSuccess Then
|
|
' bSuccess = client.CmdExec_LocalDirSet("c:\out\997", True)
|
|
' End If
|
|
' If bSuccess Then
|
|
' bSuccess = client.CmdExe_MPutFiles("*.997")
|
|
' End If
|
|
' If bSuccess Then
|
|
' bSuccess = client.CmdExe_MDelFiles("*.997")
|
|
' End If
|
|
' End If
|
|
'End Using
|
|
|
|
End Sub
|
|
|
|
End Module
|