====================File.aspx===========================
<%@ Page Language="VB" %>
<script runat="server">
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Dim id As String = Request.QueryString("id")
Response.Clear()
Response.ContentType = "text/plain"
Response.AppendHeader("Content-Disposition", "attachment; filename=TestFile" & id & ".txt")
Response.Write("You requested " & id)
Response.End()
End Sub
</script>
你可以看看这个http://www.cnblogs.com/kriss/archive/2006/02/23/335885.html