Help for FTP client upload - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Help for FTP client upload

mikrophunmikrophun Posts: 1Member
Hi everyone,

I am currently working on developing some code for transfer file from one pc to another. As I read in lot of article, those work can be done by FTP concept.

I'm using win7 and VB.NET 2010

I've got some simple source code for uploading a file, but I'm experiencing a problem which describe below


[code]System.ArgumentNullException was unhandled
Message=Value cannot be null.
Parameter name: type
ParamName=type
Source=mscorlib[/code]


it's refers to:

[code]ITCObject = Activator.CreateInstance(ITC)[/code]


Here are the source code:

[code]Imports System.IO
Imports System.Reflection
Imports System.Threading

Public Class Main

Private Sub btnBrowse_Click(ByVal sender As System.Object, e As System.EventArgs) Handles btnBrowse.Click
OpenFileDialog.ShowDialog()
tbFile.Text = OpenFileDialog.FileName
End Sub

Private Sub btnUpload_Click(ByVal sender As System.Object, e As System.EventArgs) Handles btnUpload.Click
Dim thisFile As FileInfo = New FileInfo(tbFile.Text)
Dim ITC As Type
Dim parameter() As Object = New Object(1) {}
Dim ITCObject As Object
ITC = Type.GetTypeFromProgID("InetCtls.Inet")
ITCObject = Activator.CreateInstance(ITC)
parameter(0) = CType(tbRemoteServer.Text, String)
parameter(1) = CType("PUT " + thisFile.FullName + " /" + thisFile.Name, String)
ITC.InvokeMember("execute", BindingFlags.InvokeMethod, Nothing, ITCObject, parameter)
End Sub
End Class[/code]



is there anyone could help me to resolve this problem.

Thx,
Phann
Sign In or Register to comment.