<!--Main.Aspx-->
<%@ page language="C#" %>
<%@ import namespace=System.IO %>
< runat="server">
protected override void OnInit (EventArgs e)
{
int id;
try
{
(Request.QueryString["id"]);
}
catch
{
throw (new Exception ("页面没有指定id"));
}
string filename=Server.MapPath("statichtml_"+id+".html");
//尝试读取已有文件
Stream s = GetFileStream (filename);
if (s != null)//如果文件存在并且读取成功
{
using (s)
{
Stream2Stream (s, Response.OutputStream);
Response.End ();
……