Get Stock Quotes on the Web

This sample demonstrates how easy it is to get files or data from an Internet resource ASP with PowerTCP Winsock for ActiveX. This sample connects to "finance.yahoo.com" on port 80 (the well-known port for HTTP). An HTTP GET request is then sent for the Yahoo Stock Quote Display Page, specifying the stock quote to get as a query string parameter in the url. This causes the Yahoo server to return an HTML formatted page containing the information for the stock quote, including the current price. The current price is then parsed from the response and displayed.

Launch the Stock Quotes on the Web in ASP Sample Now.

This script could be easily modified to support getting any data (not only HTML) from an Internet resource. For example, you could have a script that could grab a binary file (such as a database) and save it to the server's file system to create an "archival" script.

If you are interested in this sample, be sure to see these links: