加以下两句就行了:
response.contentType = "application/vnd.ms-excel"
response.addheader "Content-Disposition", "attachment; filename=测试.xls"
完整代码:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
response.contentType = "application/vnd.ms-excel"
response.addheader "Content-Disposition", "attachment; filename=测试.xls"
%>
<table width="800" border="1">
<tr align="center">
<td colspan="3">测试</td>
</tr>
<tr>
<td align="center">人类</td>
<td align="center">兽人</td>
<td align="center">亡灵</td>
</tr>
<tr>
<td align="center">1000</td>
<td align="center">500</td>
<td align="center">500</td>
</tr>
</table>