網站制作經常要開發下載文件的功能
<%
filename = Request
if filename = "" then
Response
else
Response
Response
Set FileStream = Server
FileStream
FileStream
FileStream
FileStream
Response
FileStream
Set FileStream = nothing
end if
%>把上述代碼存成asp類型的文件
在下載按鈕事件中加入如下代碼
System
wc
上述代碼會把服務器端的a
asp
//打開要下載的文件
System
//設置基本信息
Response
Response
Response
Response
Response
while (true)
{
//開辟緩沖區空間
byte[] buffer = new byte[
//讀取文件的數據
int leng = r
if (leng ==
break;
if (leng ==
Response
else
{
//讀出文件數據比緩沖區小
byte[] b = new byte[leng];
for (int i =
b[i] = buffer[i];
Response
}
}
r
Response
該方法有下載提示框
From:http://tw.wingwit.com/Article/program/net/201311/14277.html