I found a handy tip on the web, written by Marco Bellinaso, that shows how to cause a file to be downloaded. The tip shows how to use the Server and Response objects to perform the download. So why not just provide the URL to that web page and forget about making this a tip?
Marco's Tip URL: http://www.devx.com/vb2themax/Tip/19388
Because the tip says you must include the code in a page in order to access the Server and Response objects. This restriction can be eliminated by using HttpContext.Current to prefix the objects. For example:
I modified Marco's code and put it into a class module. A typical calling sequence is:
Dim oDF As New cDownloadFile
Which will open a dialog similar to:
Download VB.Net Code
Click here to download the VS2005 VB.Net source code [1k].
Previous Tip Tip Index Next Tip