首页 > 编程 > .NET > 正文

asp.net2.0 URL重写以及urlMappings问题(2)

2024-07-10 13:12:32
字体:
来源:转载
供稿:网友

  由于一旦进行了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);
    }

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表