Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 将文件保存到服务器_C#_Asp.net - Fatal编程技术网

C# 将文件保存到服务器

C# 将文件保存到服务器,c#,asp.net,C#,Asp.net,我需要将文件从外部服务器下载并保存到我的服务器,例如: 用户将输入以下链接,然后单击上载 我需要下载指定的文件并将其保存到我的服务器 看看WebClient类 public void Download(string url, string filenameToSaveAs) { WebClient wclient = new WebClient(); wclient.DownloadFileAsync(new Uri(url), filenameToSaveAs); } 我没有这

我需要将文件从外部服务器下载并保存到我的服务器,例如:

  • 用户将输入以下链接,然后单击上载
  • 我需要下载指定的文件并将其保存到我的服务器

看看
WebClient

public void Download(string url, string filenameToSaveAs)
{
   WebClient wclient = new WebClient();
   wclient.DownloadFileAsync(new Uri(url), filenameToSaveAs);
}

我没有这方面的背景,这门课能帮我吗?