473,385 Members | 1,641 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Can't get the Internet Transfer Control to work

I'm using VB 2005. I want to use the Inet control to get a file from a
server via HTTP.

The code to send the request is:

AxInet1.Execute("http://www.thewebsite.com/thefile.zip", "GET", "", "")

And the code to handle the response event is:

Private Sub AxInet1_StateChanged(ByVal sender As Object, ByVal e As
AxInetCtlsObjects.DInetEvents_StateChangedEvent) Handles
AxInet1.StateChanged
Dim vtData As Object
Dim intFile As Integer
intFile = FreeFile()
If (e.state = InetCtlsObjects.StateConstants.icResponseReceived)
Then
FileOpen(intFile, "thefile.zip", OpenMode.Binary,
OpenAccess.Write)
vtData = AxInet1.GetChunk(1024,
InetCtlsObjects.DataTypeConstants.icByteArray)
Do While Len(vtData) 0
FilePutObject(intFile, vtData)
vtData = AxInet1.GetChunk(1024,
InetCtlsObjects.DataTypeConstants.icByteArray)
Loop
FilePutObject(intFile, vtData)
FileClose(intFile)
End If
End Sub

I get the "response received" event, but when I call the first
"GetChunk", it just gets stuck there. What am I doing wrong? Thanks in
advance for any suggestions.

Oct 4 '06 #1
4 4301
"Franco" <cu******@yahoo.comschrieb:
I'm using VB 2005. I want to use the Inet control to get a file from a
server via HTTP.
I suggest to use 'System.Net.WebClient' instead, which has a 'DownloadFile'
method.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Oct 4 '06 #2
does this system.net.webclient inherit proxy settings from IE?

I thnk that there are a dozen ways to download stuff in the vb6 world
that were better than ITC.. i just figured that the guy has a REASON to
be using ITC instead of ServerXmlHttp for example

-Aaron
Herfried K. Wagner [MVP] wrote:
"Franco" <cu******@yahoo.comschrieb:
I'm using VB 2005. I want to use the Inet control to get a file from a
server via HTTP.

I suggest to use 'System.Net.WebClient' instead, which has a 'DownloadFile'
method.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Oct 4 '06 #3
I tried to use the Internet Transfer Control because that's the only
way I know, but if there are easier and/or better ways, I'll gladly use
one of those. Could you explain a little more what those other ways
are? Thanks.

aa*********@gmail.com wrote:
does this system.net.webclient inherit proxy settings from IE?

I thnk that there are a dozen ways to download stuff in the vb6 world
that were better than ITC.. i just figured that the guy has a REASON to
be using ITC instead of ServerXmlHttp for example

-Aaron
Herfried K. Wagner [MVP] wrote:
"Franco" <cu******@yahoo.comschrieb:
I'm using VB 2005. I want to use the Inet control to get a file from a
server via HTTP.
I suggest to use 'System.Net.WebClient' instead, which has a 'DownloadFile'
method.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Oct 5 '06 #4
I reccomend the .NET library that he's talking about

but ServerXmlHttp is a great tool also

how much stuff are you downloading; anyways?

-Aaron
Franco wrote:
I tried to use the Internet Transfer Control because that's the only
way I know, but if there are easier and/or better ways, I'll gladly use
one of those. Could you explain a little more what those other ways
are? Thanks.

aa*********@gmail.com wrote:
does this system.net.webclient inherit proxy settings from IE?

I thnk that there are a dozen ways to download stuff in the vb6 world
that were better than ITC.. i just figured that the guy has a REASON to
be using ITC instead of ServerXmlHttp for example

-Aaron
Herfried K. Wagner [MVP] wrote:
"Franco" <cu******@yahoo.comschrieb:
I'm using VB 2005. I want to use the Inet control to get a file from a
server via HTTP.
>
I suggest to use 'System.Net.WebClient' instead, which has a 'DownloadFile'
method.
>
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Oct 5 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: John | last post by:
Hi Does anyone have an example of using the Internet Transfer Control from behind a proxy server on port 8080? Thanks Regards
1
by: Ben Cox | last post by:
Trying to use the MS Internet Transfer Control in a Windows app. I get no errors but when I try to transfer files it is not working. Does anyone have any working samples. Ben
0
by: Ben Cox | last post by:
Trying to use the MS Internet Transfer Control in a Windows app. I get no errors but when I try to transfer files it is not working. Does anyone have any working samples. Ben
1
by: Ben Cox | last post by:
I am trying to using the internet transfer control in a windows app to create a simple ftp client. I am getting no errors but using execute to get and put files does not work. I have used the...
0
by: Moheb Missaghi | last post by:
Hi: I am trying to use the Transfer statement in an .aspx file to redirect and send Form and QueryString collections to a different page. A good example where this is needed is a checkout page...
4
by: Brian | last post by:
Hi, I'm trying to make an online FTP utility in C# ASP.NET using MSINET.ocx (an active X control a.k.a. "Microsoft Internet Transfer Control") I've added the reference into my project and have...
4
by: Jon Weston | last post by:
Hi all. I'm trying to use the Internet Transfer Control in an Access03 database to upload a file using FTP. It's not giving me any errors but is completely failing to upload the file. Here's the...
1
by: manontheedge | last post by:
I'm working on a program where I need to be able to get specific data from an internet site that changes daily. Basically, I'm looking at 2 to 3 numbers out of a whole lot of numbers (among other...
1
by: AccessHunter | last post by:
Hi, Please help. I am not sure if this is the right place to post this question. I was given a database that was created by a person who no longer works here.I am trying to inherit the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.