Click to See Complete Forum and Search --> : open html from the web...how??!?


July 21st, 2000, 12:46 AM
hi!
how would you open a file that is on for example www.yahoo.com/index.html for reading. the only way i know how to do this for files on teh local drive is by using the

fso = new ActiveXObject("Scripting.FileSystemObject");
f = fso.OpenTextFile("c:\\testfile.txt", ForWriting, true);

method. so instead of C:\\testfile.txt i want to read something from the web like http://www.yahoo.com/index.html but if i just replace it, it won't let me becaues the error is something like bad filename.

any ideas?
thanx for your help

Lothar Haensler
July 21st, 2000, 03:23 AM
in VB you can use the Internet Transfer Control. Call its OpenURL method and pass the URL as argument 1. It will return the file as a string or byte array.
Check the online docs.

If you want to use the API, look for InternetReadFile in wininet.dll.

July 21st, 2000, 09:35 AM
how would i open this control in vbscript(asp) ????

Lothar Haensler
July 21st, 2000, 09:36 AM
you'd have to create an ActiveX DLL and expose a method that you can call from your ASP.

July 21st, 2000, 09:44 AM
Thank You :)