View Single Post
Old Jan 19th, 2007, 6:40 PM   #8
tristolas
Newbie
 
Join Date: Jan 2007
Posts: 6
Rep Power: 0 tristolas is on a distinguished road
Dim url As String = "http://www.whatever.com/blah/"
Dim fileName As String = "ring" + times + ".jpg"
brought the error "Conversion from string "ring" to type 'Double' is not valid "
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 Module

would turning option strict or ecplicit off help ?


thanks
tristolas is offline   Reply With Quote