Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

system.invalidexception error (VS2005)

Status
Not open for further replies.

RonRepp

Technical User
Feb 25, 2005
1,031
US
Hi all:

I'm running Win 7 and VS 2005.

I'm trying upload an FTP file and I keep getting the error, saying I need a filename.

Here is my code:

Code:
Public Sub StartUpload( _
        ByVal FileName As String, ByVal FTPn As String, ByVal UserN As String, _
            ByVal PW As String, ByVal PortNum As Short)

       
        My.Computer.Network.UploadFile(FileName, FTPn, UserN, PW)

    End Sub

I have stepped through the code, searched the MSDN Online DB, and cannot figure out why I'm getting the error, unless it's a Win 7 issue.

I've done this with an old VB6 dll I made, and it works.

Ron Repp

If gray hair is a sign of wisdom, then I'm a genius.

My newest novel: Wooden Warriors
 
Can you post the actual values you are pasing through StartUploat()
 
Kliot:

If I passed them through, then you'd know my FTP info. Trust me, this same procedure works on an old VB6 program, but every one was telling me that UploadFile was the way to go.

Thanks.

Ron Repp

If gray hair is a sign of wisdom, then I'm a genius.

My newest novel: Wooden Warriors
 
You could fudge it. The importance is the structure of what you are passing. Is it ftp.somesite.net\unhappy\sad.doc, is the username somesite\username, etc. UploadFile works so either it is something wrong with what you are passing, the installation of Visual Studio, or Windows 7. I haven't heard of such a problem with Windows 7. So as Kliot said what are you passing?

-I hate Microsoft!
-Forever and always forward.
-My kingdom for a edit button!
 
Sorry for the delay...another surgery but no excuses.

Here are the values I'm passing:

StartUpload("FTP://ftp.repp.net", _
"UserName", "Password", 21)

Ron Repp

If gray hair is a sign of wisdom, then I'm a genius.

My newest novel: Wooden Warriors
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top