Solved

FTP and VB

Posted on 1998-11-11
9
279 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
 
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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Having just graduated from college and entered the workforce, I don’t find myself always using the tools and programs I grew accustomed to over the past four years. However, there is one program I continually find myself reverting back to…R.   So …
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…

758 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now