VB.NET

Moderators: seancampbell
Number of threads: 4022
Number of posts: 10035

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Help for FTP client upload Posted by mikrophun on 28 Jun 2012 at 12:29 AM
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


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



it's refers to:

ITCObject = Activator.CreateInstance(ITC)



Here are the source 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




is there anyone could help me to resolve this problem.

Thx,
Phann



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.