Getting String from array?
Hey guy's im trying to load a string from an array(in this case a url) then download the file, but i get this error below:
Argument cannot be Nothing.
Parameter name: address
Here is my code:
Dim urld As String
urld = dls.GetValue(dlcount)
My.Computer.Network.DownloadFile(urld, "image开发者_如何学Pythons/image-" + dlcount.ToString + ".png")
Form1.o.Text = Form1.o.Text + urld + vbNewLine
dls is the array.
I thought i did everything right but maybe not.
Difficult to say for sure, but it looks like urld
is Nothing
when you call the DownloadFile
method. This would be caused by the call to dls.GetValue(dlcount)
returning Nothing
.
So it's likely that there's either a problem with the GetValue
method itself, or the value of dlcount
that you're passing to it is invalid in some way.
精彩评论