I have a problem with my code. I want to download some files (I'm currently doing a patcher), but there are so many files, and I don't want to create a string for all of them.
I want to store the links in an array. But the debugger says there's and exception in WebClient
. Here's my code (fájlNév
means fileName
and fájlNévAlap
means baseFileName
): UPDATED CODE:
<!-- language: lang-c# -->
WebClient myWebClient = new WebClient();
string[] remoteUrl = new string[2] { "https://www.dropbox.com/s/62tt9w194xefk7t/", " https://www.dropbox.com/s/spni307vmk4zng9/" };
string[] fájlNév = new string[2] { "alut.dll", "DevIL.dll" };
string fájlNévAlap = "BlackBox.dll", WebResource = null;
for(int i = 0; i < remoteUrl.Length; i++) {
for(int x = 0; x < fájlNév.Length; x++) {
WebResource = remoteUrl[i] + fájlNév[x];
MessageBox.Show(WebResource);
myWebClient.DownloadFile(WebResource,fájlNév[x]);
}
}
What can I do? What is wrong?