我的代码:
string dir = "/Users/valeria/Desktop/screening/"+cell;
string remoteUri ="http://www.broadinstitute.org%2Fcmap%2FviewScan.jsp%3Ftype%3DCEL%26scan%3D"+p;
string pFileName = dir + "/p";
using (WebClient myWebClient = new WebClient())
{
myWebClient.DownloadFile(remoteUri, pFileName);
}
我的程序创建了一个文件pFileName
,但没有下载任何内容,因为出现以下异常:
未处理的异常:System.Net.WebException:找不到路径的一部分“/Users/valeria/Projects/screening/screening/bin/Debug/http:/www.broadinstitute.org/cmap/viewScan.jsp?type= CEL&scan=EC2003090503AA"。---> System.IO.DirectoryNotFoundException:找不到路径的一部分“/Users/valeria/Projects/screening/screening/bin/Debug/http:/www.broadinstitute.org/cmap/viewScan.jsp?type =CEL&scan=EC2003090503AA"
怎么了?