Solved

FTP and VB

Posted on 1998-11-11
9
281 Views
Last Modified: 2013-11-13
I'm using the inet control in VB 6 and want to connect and download a simple text file.

The problem is that when i download the file it's in binary mode not in text mode.  I could reproduce the same in FTP when i set the mode to binary and then transfert manually the file, if i want it in ascii i have to type "type ascii" in the FTP window, i've try that in the inet control but it does'nt work it freeze the command line instead, anybody know how....
0
Comment
Question by:dabellei
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 1

Expert Comment

by:MAVERICK
ID: 1444375
My Friend made a FTP client using VB..... We had alot of trouble getting things to work with the Inet control.... much better to use Winsock

Jon

0
 
LVL 1

Expert Comment

by:dwalex
ID: 1444376
I also did an FTP client in VB some time ago. I had no trouble using an FTP client DLL I found, probably at Shareware.com. One reference I can find is this one:

H&S Technology, Inc.
P.O. Box 5152
Katy, TX  77491-5152
Tel: (281) 395-0345
Email: 70531.1066@compuserve.com
URL: http://www.hnstech.com

but I don't think they're the best alternative, because they cost. The one I chose was FREE, and came from a guy in France. Saved a client $100,000 with that technology. Search for the one from France.
0
 
LVL 2

Author Comment

by:dabellei
ID: 1444377
Sorry can't acept your answer it's not really an answer...
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 3

Expert Comment

by:HATCHET
ID: 1444378
Inet1.URL = "http://w3.one.net/~kevinw/index.html"
Text1.Text = Inet1.OpenURL

Those two lines are all you need to download TEXT.
The above two lines assumes you have a Microsoft Internet Transfer Control on the same form as the code is being called from and that it's named "Inet1".  It also assumes you have a standard TextBox Control called "Text1" on the same form as the code is being called from.  You can substitute the Text1.Text with a String variable if you like and then do with the data whatever you please.

HATCHET
0
 
LVL 2

Author Comment

by:dabellei
ID: 1444379
i've try that it does'nt work
0
 
LVL 3

Expert Comment

by:HATCHET
ID: 1444380
I tested it in a new project.  What do you mean it doesn't work?!  What version of VB are you using?  What OS you have?

HATCHET
0
 
LVL 1

Accepted Solution

by:
soeding earned 100 total points
ID: 1444381
HATCHET:

Dim txt As String
Dim b() As Byte
Dim t As Integer

b() = Inet1.OpenURL("http://myURL", 1)

For t = 0 To UBound(b) - 1
    txt = txt + Chr(b(t))
Next

RichTextBox1.Text = txt

0
 
LVL 1

Expert Comment

by:soeding
ID: 1444382
(answer was addressed to daballei ;-)
0
 
LVL 3

Expert Comment

by:HATCHET
ID: 1444383
=]
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
If you haven’t already, I encourage you to read the first article (http://www.experts-exchange.com/articles/18680/An-Introduction-to-R-Programming-and-R-Studio.html) in my series to gain a basic foundation of R and R Studio.  You will also find the …
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question