由于一旦進行了url重寫,原先的webform中的action會發(fā)生改變,容易造成:請求的資源不存在問題具體怎么樣?各位dx看看就清楚了!!!
所有才有了這個responsefilter了,實現(xiàn)如下:
public class responsefilter : system.io.stream
{
public responsefilter(system.io.stream sink, string _str)
{
_sink = sink;
//
// todo: 在此處添加構(gòu)造函數(shù)邏輯
//
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);
}
新聞熱點
疑難解答
圖片精選