如何更改输入请求流 [英] How can I change the Input request stream
问题描述
详细信息是:
我想将输入流中的文本1"替换为文本2"
第一个:我将Request.Filter用作 http://msdn.microsoft. com/en-us/library/system.web.httprequest.filter.aspx 但是这种方式我只能将一个字节数据替换为另一个字节,不能将字符串替换为字符串,也不能更改缓冲区大小.我需要使用其他字节数组(content和buffer.length)访问并替换旧缓冲区.
第二个:我尝试使用ISAPI筛选器,但是似乎IIS 7及更高版本不再支持SF_NOTIFY_READ_RAW_DATA.我谷歌,结果是我应该写一个本地的HttpModule与CHttpModule :: OnReadEntity事件.是吗?
如果您能告诉我如何更改输入请求流,将不胜感激.
非常感谢.
Huy
Detail is:
I want to replace the ''Text 1'' in the Input stream to ''Text 2''
The first: I use the Request.Filter as http://msdn.microsoft.com/en-us/library/system.web.httprequest.filter.aspx But this way I can only replace a byte data by an other byte, I can not replace a string by a string and I also can not change buffer size. I need to access and replace the old buffer by an other byte array (content and buffer.length)
The second: I try to use a ISAPI Filter, but It seem that the IIS 7 and above is no longer support for SF_NOTIFY_READ_RAW_DATA. I google and result is I should write a native HttpModule with CHttpModule::OnReadEntity event. Is it right ?
I would be very appreciate if you can tell me how I can change the input request stream.
Thank you very much.
Huy
推荐答案
看看下面类似的问答"讨论.
http://forums.asp.net/t/1388075.aspx/1
Have a look at similar Question-Answer discussion below.
http://forums.asp.net/t/1388075.aspx/1
这篇关于如何更改输入请求流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!