asp.net2.0 URL重写以及urlMappings问题(2)
点击次数:35 次 发布日期:2008-11-21 22:26:26 作者:源代码网
|
源代码网推荐
源代码网整理以下 由于一旦进行了URL重写,原先的WEBFORM中的Action会发生改变,容易造成:请求的资源不存在问题具体怎么样?各位DX看看就清楚了!!!
所有才有了这个ResponseFilter了,实现如下:
源代码网整理以下public class ResponseFilter : System.IO.Stream
{
public ResponseFilter(System.IO.Stream sink, string _str)
{
_sink = sink;
//
// TODO: 在此处添加构造函数逻辑
//
this.str = _str;
}
private string str = "";
private System.IO.Stream _sink;
private long _position;
private System.Text.Encoding end = System.Text.Encoding.GetEncoding("GB18030");
private System.Text.StringBuilder oOutput = new System.Text.StringBuilder();
// The following members of Stream must be overriden.
public override bool CanRead
{
get { return true; }
}
源代码网整理以下 public override bool CanSeek
{
get { return true; }
}
源代码网整理以下 public override bool CanWrite
{
get { return true; }
}
源代码网整理以下 public override long Length
{
get { return 0; }
}
源代码网整理以下 public override long Position
{
get { return _position; }
set { _position = value; }
}
源代码网整理以下 public override long Seek(long offset, System.IO.SeekOrigin direction)
{
return _sink.Seek(offset, direction);
}
源代码网整理以下 public override void SetLength(long length)
{
_sink.SetLength(length);
}
源代码网供稿. |