![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Jan 2007
Posts: 6
Rep Power: 0
![]() |
download images (incrementing url) ?
I'm not sure if this is something Visual Basic's for;
if not, would it be simplest with a scripting language or command prompt or what? I want to download a bunch of images to harddrive from internet all images have same URL exept the number increases for example I would do something like For X = 1 to 172 download http://www.blah.com/lala/imageX to C:\DOCUME~\User\Images\ Next |
|
|
|
|
|
#2 |
|
Hobbyist Programmer
|
if you want a program that will do that you can get a crawler. this is one i have tried http://www.download.com/Advanced-Sit...-10155161.html
__________________
i dont know much about programming but i try to help |
|
|
|
|
|
#3 |
|
Newbie
Join Date: Jan 2007
Posts: 6
Rep Power: 0
![]() |
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? |
|
|
|
|
|
#4 |
|
Hobbyist Programmer
|
try scripitng with wget
__________________
i dont know much about programming but i try to help |
|
|
|
|
|
#5 | |
|
Caffeinated Neural Net
![]() Join Date: Jun 2005
Location: Wet west coast of Canada
Posts: 1,126
Rep Power: 5
![]() |
Quote:
__________________
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 |
|
|
|
|
|
|
#6 |
|
Newbie
Join Date: Jan 2007
Posts: 6
Rep Power: 0
![]() |
For WebClient.DownloadFile Method, I don't know where to start; a console or windows application?
can I use this method within either one? If I do windows form, would I just replace Public Class Form1 with Public Class WebClient or do I have to edit the "meta-file" with <ComVisibleAttribute(True)> _ Public Class WebClient Inherits Component Also the only way I know how to trigger the method(download file) is through a button declared as Private Sub Button1_Click()... but can I declare Public Sub DownloadFile() inside of this^ Private ButtonClick Sub ? Then would I just stick the method inside of an incrementing loop ? For example Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim adress As String = "http://www.contoso.com/library/homepage/images/"
Dim number As Integer
For number = 1 To 174
Dim fileName As String = "ms-banner.gif" + number
Dim fulladress As String = Nothing
' Create a new WebClient instance.
Dim myWebClient As New Net.WebClient()
' Concatenate the domain with the Web resource filename. Because DownloadFile
'requires a fully qualified resource name, concatenate the domain with the Web resource file name.
fulladress = adress + fileName
Console.WriteLine("Downloading File ""{0}"" from ""{1}"" ......." + ControlChars.Cr + ControlChars.Cr, fileName, fulladress)
' The DownloadFile() method downloads the Web resource and saves it into the current file-system folder.
myWebClient.DownloadFile(fulladress, fileName)
Console.WriteLine("Successfully Downloaded file ""{0}"" from ""{1}""", fileName, fulladress)
Console.WriteLine((ControlChars.Cr + "Downloaded file saved in the following file system folder:" + ControlChars.Cr + ControlChars.Tab + Application.StartupPath))
Next
End Sub
End ClassIs doing it through console or wget script is simpler (requires less steps) ? Last edited by tristolas; Jan 17th, 2007 at 7:45 PM. |
|
|
|
|
|
#7 | |||||
|
Caffeinated Neural Net
![]() Join Date: Jun 2005
Location: Wet west coast of Canada
Posts: 1,126
Rep Power: 5
![]() |
Quote:
Quote:
Quote:
Quote:
Quote:
__________________
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 |
|||||
|
|
|
|
|
#8 |
|
Newbie
Join Date: Jan 2007
Posts: 6
Rep Power: 0
![]() |
Dim url As String = "http://www.whatever.com/blah/" Dim fileName As String = "ring" + times + ".jpg" I didn't declare any double variables so don't know how this happens I also tried converting the incrementing integer("times") to string, but didn't help Module Module1
Sub Main()
Dim times As Integer
For times = 1 To 164
Dim url As String = "http://www.whatever.com/blah/"
Dim numba As String = Convert.ToString(times)
Dim fileName As String = "ring" + times + ".jpg"
Dim full_path As String = Nothing
' Create a new WebClient instance.
Dim myWebClient As New Net.WebClient()
full_path = url + fileName
myWebClient.DownloadFile(full_path, fileName)
Console.WriteLine((ControlChars.Cr + "Downloaded file saved in" + ControlChars.Cr + ControlChars.Tab))
Next
End Sub
End Modulewould turning option strict or ecplicit off help ? thanks |
|
|
|
|
|
#9 | |
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5
![]() |
Quote:
Dim times As Integer
For times = 1 To 164
Dim url As String = "http://www.whatever.com/blah/"
Dim numba As String = Convert.ToString(times)
Dim fileName As String = "ring" + times + ".jpg"Dim fileName As String = "ring" + numba + ".jpg" |
|
|
|
|
|
|
#10 |
|
Newbie
Join Date: Jan 2007
Posts: 6
Rep Power: 0
![]() |
yeah thanks for pointing out hehe
I just don't know how to execute it ("debug" is disabled), I did it as a console app (just a *.vb file, nothing else) |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Downloading series of images? | ElijahX | Visual Basic | 3 | Dec 16th, 2006 11:59 PM |
| Displaying images from database | raikkonen | ASP | 2 | Apr 14th, 2006 2:03 PM |
| Blank images from CreateImages with animation cells | Flint50 | Java | 0 | Apr 10th, 2006 6:35 AM |
| Download Manager | bigguy | Visual Basic | 16 | Oct 31st, 2005 3:07 PM |
| Water Mark your images with php | bambolin | PHP | 12 | Sep 24th, 2005 12:57 PM |