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, "images/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
urldisNothingwhen you call theDownloadFilemethod. This would be caused by the call todls.GetValue(dlcount)returningNothing.So it’s likely that there’s either a problem with the
GetValuemethod itself, or the value ofdlcountthat you’re passing to it is invalid in some way.