VBScript Question

SampsonC used Ask the Experts™
I'm trying to programatically connect to a URL using VBScript and retrieve the contents of the page.  How do you do this in VBScript?  The script I'm writing will run inside of a tool that uses VBScript as it's scripting language, not under IIS, so I don't have access to ASP objects.  

I'm also trying to connect directly to a machine/port using TCP/IP sockets as well.  How do you do this?

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Function GetPage(ByVal URL)
     Dim HttpRequest

     Set HttpRequest = CreateObject("Microsoft.XMLHTTP")
     HttpRequest.Open "GET", URL, False
     GetPage = HttpRequest.responseText
End Function

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial