Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > Pro VB.NET 2002/2003
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Pro VB.NET 2002/2003 For advanced Visual Basic coders working .NET version 2002/2003. Beginning-level questions will be redirected to other forums, including Beginning VB.NET.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #21 (permalink)  
Old March 17th, 2004, 05:06 AM
Registered User
 
Join Date: Mar 2004
Location: , , Hong Kong.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I've tried to run the putfile in XP box, and it working fine.

                ' --------------------
                ' Transfer via standard FTP
                ServerName = strLocation.ToUpper
                FTPLogin = txtUserID.Text
                FTPPassword = txtPassword.Text

                ' Instantiate a new FTP object
                Dim INet, INetConn As Integer
                Dim RC As Boolean
                ' FTP_TRANSFER_TYPE_ASCII
                ' FTP_TRANSFER_TYPE_BINARY
                INet = InternetOpen("CTM_SMS_FTP_Control", 1, vbNullString, vbNullString, 0)
                INetConn = InternetConnect(INet, ServerName, 0, FTPLogin, FTPPassword, 1, 0, 0)
                RC = FtpPutFile(INetConn, strFileName, "\a\upload.txt", 0, 0)

                If RC Then
                    MsgBox("Transfer succesfull!")
                End If
                InternetCloseHandle(INetConn)
                InternetCloseHandle(INet)

                '------------------

Keung
Reply With Quote
  #22 (permalink)  
Old April 13th, 2004, 01:15 PM
Registered User
 
Join Date: Apr 2004
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I attempted to use fig000's solution, and have another problem altogether. I can't figure out where the references in the code are called from. I receive the following errors:

Name 'InternetOpen' is not declared
Name 'InternetConnect' is not declared
Name 'FTPGetFile' is not declared
Name 'InternetCloseHandle' is not declared

Do I need to add a reference for these objects to be recognized? I'm rather new to VB, and any assistance would be appreciated.



Reply With Quote
  #23 (permalink)  
Old April 13th, 2004, 11:02 PM
Registered User
 
Join Date: Jul 2003
Location: Knoxville, TN, USA.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Did you use the declarations at the top of the code snippet? That should take care of declarations. And I kind of doubt those dlls wouldn't be on your hard drive.

Fig000

Reply With Quote
  #24 (permalink)  
Old April 16th, 2004, 12:27 PM
Registered User
 
Join Date: Apr 2004
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks, Fig!  I'm rokken like Don Dokken!

My apologies for not reading your original code snippet more closely. I actually did an FTPPutFile, so I'll post that sample for diversity's sake:

        Dim INet, INetConn As Integer
        Dim RC As Boolean
        INet = InternetOpen("blah", 1, vbNullString, vbNullString, 0)
        INetConn = InternetConnect(INet, "remoteIPAddresshere", 0, "myUserId", "myPassword", 1, 0, 0)
        RC = FtpPutFile (INetConn, "C:\LDir1localfile.txt", "/RDir1/RDir2/remotefile.txt", 0, 0)
        If RC Then MessageBox.Show("Transfer successful!")
        InternetCloseHandle(INetConn)
        InternetCloseHandle(INet)
Reply With Quote
  #25 (permalink)  
Old April 19th, 2004, 08:38 PM
Registered User
 
Join Date: Apr 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I've successfully ftp within a LAN using the codes here. Thanks a lot.

But now I need to ftp from my LAN to a remote server in another LAN. There are gateways for both LANs. Not sure how to set the proxyName and proxyPassby parameters for the InternetOpen function. I've changed the AccessType to 0, presumably representing access_by_proxy. Also tried to use the ip addresses of the gateways as the proxy. but havn't been successful. Any experiences on that? Thanks.

Reply With Quote
  #26 (permalink)  
Old April 29th, 2004, 05:17 AM
Registered User
 
Join Date: Apr 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi ppl,

I am Having the same problem as mikeymac,

Name 'InternetOpen' is not declared
Name 'InternetConnect' is not declared
Name 'FTPGetFile' is not declared
Name 'InternetCloseHandle' is not declared

What exactly do i have to do to solve this problem?
I tried to put these code below right under the iherits... Where exactly do i have to put the code..

Dim INet, INetConn As Integer
Dim RC As Boolean


Thanks alot.

Dave



Reply With Quote
  #27 (permalink)  
Old August 27th, 2004, 10:27 AM
Registered User
 
Join Date: Aug 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I run the code in my XP. It works well.

I am wondering how to download file in the BACKGROUND so I can still use my foreground to do other things. Any suggestion or comments?

Thank in advance,
Rebecca
Reply With Quote
  #28 (permalink)  
Old September 2nd, 2004, 02:20 PM
Registered User
 
Join Date: Sep 2004
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

My code works fine too. However, is there a way to make file name NOT case-sensitive? For example, when getting file "FOO.txt" from the server and on the server name is "foo.txt" the program could not find it.

Any ideas?

Thanks
Reply With Quote
  #29 (permalink)  
Old September 9th, 2004, 04:29 PM
Registered User
 
Join Date: Jul 2003
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to TDot Send a message via Yahoo to TDot
Default

Here ya go people...

http://support.microsoft.com/default...b;en-us;832679

Reply With Quote
  #30 (permalink)  
Old September 13th, 2004, 07:36 PM
Registered User
 
Join Date: Jul 2003
Location: Knoxville, TN, USA.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

TDOT,

  Thanks for the link. I started this thread over a year ago and it seems like there was no formal description of how to do this. I think the MS version is more compicated than mine but probably has more features.

  This thread has had a long life :-).

Fig

Reply With Quote
Reply


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Uploading Text File to FTP server in vb.net KiruShan .NET Framework 2.0 4 July 29th, 2014 03:02 AM
loop through tables inside .mdb file using VB.NET remya1000 General .NET 3 September 24th, 2007 01:45 PM
Start a program inside another program Silje Classic ASP Professional 1 November 16th, 2004 02:08 AM
Running FTP within VB .NET Application ocarroll General .NET 7 September 28th, 2004 05:25 PM



All times are GMT -4. The time now is 07:16 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.