Upload to FTP - Inet1 error!
Upload to FTP - Inet1 error!
Upload to FTP - Inet1 error!
Upload to FTP - Inet1 error!
Upload to FTP - Inet1 error!
Upload to FTP - Inet1 error! Upload to FTP - Inet1 error! Upload to FTP - Inet1 error! Upload to FTP - Inet1 error! Upload to FTP - Inet1 error! Upload to FTP - Inet1 error! Upload to FTP - Inet1 error! Upload to FTP - Inet1 error!
Upload to FTP - Inet1 error! Upload to FTP - Inet1 error!
Upload to FTP - Inet1 error!
Go Back  Xtreme Visual Basic Talk > > > Upload to FTP - Inet1 error!


Reply
 
Thread Tools Display Modes
  #1  
Old 12-06-2006, 03:50 AM
Putteh Putteh is offline
Newcomer
 
Join Date: Dec 2006
Posts: 6
Default Upload to FTP - Inet1 error!


Hi!

I wanna upload files to an FTP-server and I have this code:

Private Sub cmdUpload_Click()
With Inet1
.Protocol = "icFTP"
.UserName = "MYUSERNAME"
.Password = "MYPASSWORD"
.RemoteHost = "ftp.musikporten.se/"
.Execute("SEND C:\Documents and Settings\jb04pahellg\Skrivbord\test.txt")
End With
End Sub

-------
The think is the "Inet1" command i underlined as an ERROR. Why?
And one more (newbie)-thing - Where should I but this code? In what component?
I'm totally new at VB, but I think I'll have a good grip on its possibilities soon.

Thanks!
Regards Putteh
Reply With Quote
  #2  
Old 12-06-2006, 04:10 AM
Volte's Avatar
VolteUpload to FTP - Inet1 error! Volte is offline
Ultimate Contributor

Retired Leader
* Guru *
 
Join Date: Aug 2001
Posts: 5,344
Default

Is there an Inet control on your form? If not, add the Microsoft Internet Transfer Control to your toolbox and put one on the form.
Reply With Quote
  #3  
Old 12-06-2006, 05:33 AM
bassmaster52 bassmaster52 is offline
Regular
 
Join Date: Aug 2005
Posts: 59
Default

Quote:
The think is the "Inet1" command i underlined as an ERROR. Why?
And one more (newbie)-thing - Where should I but this code? In what component?
I'm totally new at VB, but I think I'll have a good grip on its possibilities soon.
Make sure you have the Inet control on the form and that the control is called Inet1. Make sure you have a command button on the form named cmdUpload, the code you have will be place in the cmdUpload click actions.
Reply With Quote
  #4  
Old 12-12-2006, 05:23 AM
Putteh Putteh is offline
Newcomer
 
Join Date: Dec 2006
Posts: 6
Default

Quote:
Originally Posted by Volte
Is there an Inet control on your form? If not, add the Microsoft Internet Transfer Control to your toolbox and put one on the form.
There's no Microsoft Internet Transfer Control in my toolbox. How can I add one, and where from?
Thanks again.
Reply With Quote
  #5  
Old 12-12-2006, 05:27 AM
Volte's Avatar
VolteUpload to FTP - Inet1 error! Volte is offline
Ultimate Contributor

Retired Leader
* Guru *
 
Join Date: Aug 2001
Posts: 5,344
Default

Right click on the Toolbox, click Components, find it in the list that comes up. Once it is there, add one to the form.
Reply With Quote
  #6  
Old 12-12-2006, 06:42 AM
Putteh Putteh is offline
Newcomer
 
Join Date: Dec 2006
Posts: 6
Default

Quote:
Originally Posted by Volte
Right click on the Toolbox, click Components, find it in the list that comes up. Once it is there, add one to the form.
Thanks dude..
But what's next? I've chosen these options for my Microsoft Internet Transfer Control 6.0:

GENERAL
Access Type: 0 - icUseDefault
Proxy:
Request Timeout: 60

URL
URL: ftp://myftp.se:mypass@ftp.myftp.se
Protocol: 2 - icFTP
RemoteHost: ftp.myftp.se
RemotePort: 21
Document: NOTHING - WHAT'S THIS?
UserName: MyUsername
Password: MyPassword

is that part correct?

Then I named the MS Internet Transfer Control to "AxInet1"..
What's next? I put a button on the form and named it cmdUpload.
What code should I put in the button?

Thanks!
Reply With Quote
  #7  
Old 12-12-2006, 06:51 AM
Volte's Avatar
VolteUpload to FTP - Inet1 error! Volte is offline
Ultimate Contributor

Retired Leader
* Guru *
 
Join Date: Aug 2001
Posts: 5,344
Default

You already wrote the code for your button; it's in the first post, remember? And the control should be named Inet1, not AxInet1, because that's what it is called in that code. Incidentally, where did you get AxInet1 from? That's what the control would be called if you were using it from VB.NET.

For information about the Inet control (and basically every other control) highlight the Inet control that you placed on your form and push F1. The MSDN library has documentation for this control, and if you select Methods and choose Execute method and select Example on that page, you will see a full example of FTP using Inet. If you have a problem with syntax or something that feels like it should have a very simple answer, the first place you should look is the MSDN.
Reply With Quote
  #8  
Old 12-12-2006, 06:58 AM
Putteh Putteh is offline
Newcomer
 
Join Date: Dec 2006
Posts: 6
Default

Quote:
Originally Posted by Volte
You already wrote the code for your button; it's in the first post, remember? And the control should be named Inet1, not AxInet1, because that's what it is called in that code. Incidentally, where did you get AxInet1 from? That's what the control would be called if you were using it from VB.NET.

For information about the Inet control (and basically every other control) highlight the Inet control that you placed on your form and push F1. The MSDN library has documentation for this control, and if you select Methods and choose Execute method and select Example on that page, you will see a full example of FTP using Inet. If you have a problem with syntax or something that feels like it should have a very simple answer, the first place you should look is the MSDN.
Yeah I remember
But when I put this code:

Private Sub cmdUpload_Click()
With Inet1
.Protocol = "icFTP"
.UserName = "MYUSERNAME"
.Password = "MYPASSWORD"
.RemoteHost = "ftp.musikporten.se/"
.Execute("SEND C:\Documents and Settings\jb04pahellg\Skrivbord\test.txt")
End With

in the cmdUpload (button) it says that ".Execute("SEND C:\Documents and Settings\jb04pahellg\Skrivbord\test.txt")" is wrong.

This is the error-message:

"Overload resolution failed because no accessible 'Execute' accepts this number of arguments."

But if I change "With Inet1" to "With AxInet1" the .Execute-command is no longer wrong..but instead "AxInet1" is underlined as an error.
I'm so confused :P I don't even know if I'm using .NET or what. I only know that my software is called Microsoft Visual Basic 2005 Express Edition. Hehe, sorry if I'm confusing you now..

Please help me some more
Thanks.
Reply With Quote
  #9  
Old 12-12-2006, 07:22 AM
Volte's Avatar
VolteUpload to FTP - Inet1 error! Volte is offline
Ultimate Contributor

Retired Leader
* Guru *
 
Join Date: Aug 2001
Posts: 5,344
Default

Well that explains absolutely everything. You are not using VB6 at all -- VB2005 is based on .NET -- and therefore you don't even need to be using the Inet control at all. In fact, you shouldn't be. Using COM components from VB6 in .NET is generally to be avoided.

However this poses a slight problem in that there is no simple way to do FTP transfers in .NET: not as simple as in VB6 at least. In VB2005 there is a class called FtpWebRequest that may help you out. Check that out in the MSDN and look for the example there. It is rather large and daunting but it should explain itself fairly thoroughly. Unfortunately, I know nothing about it personally, so I may be of limited assistance.
Reply With Quote
  #10  
Old 12-12-2006, 12:33 PM
Putteh Putteh is offline
Newcomer
 
Join Date: Dec 2006
Posts: 6
Default

Quote:
Originally Posted by Volte
Well that explains absolutely everything. You are not using VB6 at all -- VB2005 is based on .NET -- and therefore you don't even need to be using the Inet control at all. In fact, you shouldn't be. Using COM components from VB6 in .NET is generally to be avoided.

However this poses a slight problem in that there is no simple way to do FTP transfers in .NET: not as simple as in VB6 at least. In VB2005 there is a class called FtpWebRequest that may help you out. Check that out in the MSDN and look for the example there. It is rather large and daunting but it should explain itself fairly thoroughly. Unfortunately, I know nothing about it personally, so I may be of limited assistance.
Darn..hehe.
But do you know if/where I can download VB6 and if I can convert my project från .NET to VB6? That should solve the problem..
I used to work in VB6 - and now I know why it seemed strange why some of my old commands didn't work :P Is .NET some sort of update to VB6, or what?

Thanks again, dude. I really appreciate your **** good help
Reply With Quote
  #11  
Old 12-12-2006, 12:38 PM
MikeJ's Avatar
MikeJUpload to FTP - Inet1 error! MikeJ is offline
Retread

Retired Moderator
* Expert *
 
Join Date: Sep 2002
Location: Austin, Texas
Posts: 6,747
Default

1. You don't "download" VB6. You pay for it. There is no free express edition.

2. You don't downgrade from VB.NET to VB6. VB.NET is the next incarnation of Visual Basic.
__________________
{ Lex Fori } { Locus Classicus } { Rutilus Scrinium }
Osculare pultem meam!
Reply With Quote
  #12  
Old 12-12-2006, 12:49 PM
wayneph's Avatar
waynephUpload to FTP - Inet1 error! wayneph is offline
Web Junkie

Retired Moderator
* Expert *
 
Join Date: Apr 2004
Location: D/FW, Texas, USA
Posts: 8,393
Default

This class can help with basic FTP commands in VS 2005. (.NET 2.0)

http://www.codeproject.com/vb/net/FtpClient.asp
__________________
-- wayne, MSSM Retired
> SELECT * FROM users WHERE clue > 0
0 rows returned
Reply With Quote
  #13  
Old 12-12-2006, 02:55 PM
Putteh Putteh is offline
Newcomer
 
Join Date: Dec 2006
Posts: 6
Default

Darn, this is hard
Reply With Quote
  #14  
Old 12-12-2006, 03:07 PM
reboot's Avatar
rebootUpload to FTP - Inet1 error! reboot is offline
Keeper of foo

Retired Moderator
* Guru *
 
Join Date: Nov 2001
Location: Graceland
Posts: 15,614
Default

Programming is hard. If it wasn't we'd get paid the same thing as the people at McDonalds....
__________________
~ Quod non mortiferum, fortiorem me facit ~

Avatar by lebb
Reply With Quote
  #15  
Old 12-12-2006, 09:14 PM
PrOpHeT's Avatar
PrOpHeTUpload to FTP - Inet1 error! PrOpHeT is offline
Hopelessly confused...

* Expert *
 
Join Date: Mar 2001
Location: Tyler, Tx.
Posts: 3,055
Default

Ahhh, McDonalds...

Providing quality jobs for philosophy majors everywhere.
__________________
When you earnestly believe you can compensate for a lack of skill by doubling your efforts, there's no end to what you can't do ;)

For the love of Gold...
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Upload to FTP - Inet1 error!
Upload to FTP - Inet1 error!
Upload to FTP - Inet1 error! Upload to FTP - Inet1 error!
Upload to FTP - Inet1 error!
Upload to FTP - Inet1 error!
Upload to FTP - Inet1 error! Upload to FTP - Inet1 error! Upload to FTP - Inet1 error! Upload to FTP - Inet1 error! Upload to FTP - Inet1 error! Upload to FTP - Inet1 error! Upload to FTP - Inet1 error!
Upload to FTP - Inet1 error!
Upload to FTP - Inet1 error!
 
Upload to FTP - Inet1 error!
Upload to FTP - Inet1 error!
 
-->