Advertisement
ASP_Volume2 Internet/ HTML #27414

UPDATED - Download Control (without Winsock) v2.1

I wanted a quick way to add the ability to retrieve files over the 'net w/o adding extra files to the distribution. Found an example here by Chloe that used the AsyncRead functions of a user control. I didn't really think that control went far enough, so I wrote this new one with lots more flexibility. This is also a visible control which acts like it's own progress bar on the form (nothing fancy, there are plenty of PB examples here if you wanna soup it up.) It's also pretty smart about file names and can automatically halt the DL if redirected (say, to a 404.html file.) Just thrown in are my own functions for collapsing a path (replace some folders with ...) to fit a given space and returning a formatted size in b, k, M or G given a # of bytes. Thanks also to Mr. Bobo - I threw his Browse for Folder routine in just so I wouldn't have to add the common dialog to the demo form (not actually used in DL control.) Hope you all find this useful, I know I will! ;-) NEW TO UPDATED V2: - Option to Rename save file if redirected - Properties to retrive download information outside of the events - Option to wait till download complete before returning to main form code. Possible uses: - Have program check for updates over net - Get changeable content (news/blogs/tips/ads/etc) - Retrieve customized batch files

AI

AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Source Code
original-source
Upload
Original Comments (3)
Recovered from Wayback Machine