Home:ALL Converter>Download a file from a Variable URL c#

Download a file from a Variable URL c#

Ask Time:2014-06-05T23:54:01         Author:user3711938

Json Formatter

We have been requested to go and Download an order file from our customers site via a url. I want to do something like this.

string remoteUri = "http://www.contoso.com/library/homepage/images/";
string fileName = "ms-banner.gif", myStringWebResource = null;

// Create a new WebClient instance.
using (WebClient myWebClient = new WebClient())
{
    myStringWebResource = remoteUri + fileName;
    // Download the Web resource and save it into the current filesystem folder.
    myWebClient.DownloadFile(myStringWebResource, fileName);        
}

But the URL will be variable as we have to specify the Date and Time within the URL we post.

And the File we download will be variable also.

As I'm new to C# I would like some advise as to how to achieve this?

Thanks In Advance

Author:user3711938,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/24064780/download-a-file-from-a-variable-url-c-sharp
yy