Hello,

I am trying to read the contents of a text file from a website. I am running Visual Basic 6 (SP6). I need to add this code to an existing application written in VB6, so VB.NET is out.

The file I want to read is on our website. It is a text file containing a filename. I need to get this file name so that I can download it. So help with both steps would be nice.

Thanks for your time,

Doug

Recommended Answers

All 3 Replies

Quite simple with the URLDownloadToFile API...

1. Use API to download file with file name
2. Open with Open Statement, Line Input Function, FreeFile Function, Close Statement
3. Use API to download named file
4. Continue on with rest of program

Good Luck

I have seen this URLDownloadToFile API. I had a little trouble with it but I'm still working with it and will probably use it to download the named file.

However, is it possible to read lines from the text file online, I mean, without downloading it. Read the filename in the text file directly from the website.

Thanks again!

Doug

Quite simple with the URLDownloadToFile API...

1. Use API to download file with file name
2. Open with Open Statement, Line Input Function, FreeFile Function, Close Statement
3. Use API to download named file
4. Continue on with rest of program

Good Luck

Nope, not as far as I know. You could also use the webbrowser control and read the file that way but once again it is "downloaded".

Good Luck

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.