public static class StreamHelper
{
public static Stream DownloadFile(string path)
{
using (var client = new WebClient())
{
var stream = client.DownloadData(path);
var outStream = new MemoryStream(stream);
return outStream;
}
}
}
原文:http://www.cnblogs.com/iainYang/p/6214938.html