使用Web客户端下载Zip文件,下载文件后,我正在发送带有下载路径位置的电子邮件通知。但是当单击下载的路径文件夹时,应该打开,但由于下载路径中的空间而没有发生
[enter image description here][1]
法典:
string fileName = Path.GetFileName(remoteFilePathWithoutQuery);
string downloadpath =@"C:/Test/RDD Projects/TempProject/"
webClient.DownloadFile(new System.Uri(remoteFilePath), downloadpath + fileName)
如果我给(下载路径 = @"C:/Test/RDD Projects/TempProject/">
能够下载文件,但我无法从该位置打开文件。
我尝试删除空间并添加 %20 (@"C:/Test/RDD%20Projects/TempProject/"( 文件无法下载
有人可以帮助我吗?
尝试使用 Path.Combine。
webClient.DownloadFile(new System.Uri(remoteFilePath),Path.Combine(downloadpath,filename));