首页 > 编程 > .NET > 正文

asp.net 下载文件时输出文件内容

2024-07-10 12:38:54
字体:
来源:转载
供稿:网友
代码如下:
<script language="C#" runat="server">
protected void Page_Load(object sender, System.EventArgs e)
{
Response.ContentType = "application/x-shockwave-flash";
string fileFlash = Server.MapPath("/") + "1.swf";
System.IO.FileStream fileStream = new System.IO.FileStream(fileFlash, System.IO.FileMode.Open);
byte[] buffer = new byte[fileStream.Length];
fileStream.Read(buffer,0,(int)fileStream.Length);
Response.BinaryWrite(buffer);
}
</script>
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表