0
我们已被要求去通过网址从我们的客户网站下载订单文件。 我想做这样的事情。从变量URL下载文件c#
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);
}
但是,由于我们必须在我们发布的网址中指定日期和时间,因此网址将会变化。
而且我们下载的文件也是可变的。
由于我是C#的新手,我想就如何实现这一点提供建议?
提前致谢
你说URL /文件会根据什么变量?你有一个可能的URL的例子吗?我看不出问题在哪里?您不确定如何构建基于日期和时间的网址? –