C#实现从服务器上下载DLL文件
2013-07-26 16:41 dhtj 阅读(785) 评论(0) 编辑 收藏 举报C#实现从服务器上下载DLL文件,具体代码如下:
var fullQualifiedPathToDll = Server.MapPath("/") + "/bin/mydll.dll";
var myFileStream = new FileStream(fullQualifiedPathToDll, FileMode.Open);
var fileSize = myFileStream.Length;
var buffer = new byte[(int)FileSize];
myFileStream.Read(buffer, 0, (int)FileSize);
myFileStream.Close();
Response.BinaryWrite(buffer);