0
我想下载PDF到一个内存流,我将附加到一个MailMessage。这是我的代码:WebClient.DownloadData()返回0字节
string pdfUrl = "http://dev.domain.com/pdf+files/sample.pdf";
WebClient client = null;
MemoryStream stream;
try
{
client = new WebClient();
stream = new MemoryStream(client.DownloadData(pdfUrl));
attachments.Add(new Attachment(stream, "Sample.pdf");
}
finally
{
client.Dispose();
}
字节[]从client.DownloadData(pdfUrl)返回具有0
任何想法的长度?