当前位置:主页 > 软件编程 > .NET代码 >

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

时间:2022-10-25 09:31:59 | 栏目:.NET代码 | 点击:

复制代码 代码如下:

<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>

您可能感兴趣的文章:

相关文章