View Single Post
Old Jan 16th, 2007, 6:37 PM   #5
lectricpharaoh
Caffeinated Neural Net
 
lectricpharaoh's Avatar
 
Join Date: Jun 2005
Location: Dry west coast of Canada
Posts: 1,010
Rep Power: 5 lectricpharaoh will become famous soon enough
Quote:
Originally Posted by tristolas View Post
no programming language has the ability to go to a specified url & save it to computer?
The URLs are the URLs of the images; not of the pages that contain the images... is a web crawler necessary for this?
All you need is the URL. You can use the System.Net.WebClient.DownloadData() method to fill a byte array with the file contents. You can then do whatever with this, including saving it to disk, manipulating the data, or whatever you want to do. If you need to do this without blocking on the current thread, you can use the DownloadDataAsync() method instead (don't call the blocking version in multiple threads simultaneously; it will throw an exception). Both links describe the methods; the first one also has code examples. I don't feel like typing a lengthy explanation of asynchronous I/O right now, but if you're familiar with callback functions (or whatever VB calls 'em), then it's pretty easy to use non-blocking I/O (though you really don't need it for this, especially if all the files are fetched from the same server).
__________________
And once again, Probability proves itself willing to sneak into a back alley and service Drama as would a copper-piece harlot.
- Vaarsuvius, Order of the Stick
lectricpharaoh is offline   Reply With Quote