0
사용자 지정 OutputCacheProvider CacheEntry 버퍼에서 textraw를 가로 채려고합니다.OutputCache 버퍼에서 HTML 추출
사용할 때 cacheEntry.ResponseElements.First()
내 html 페이지의 절반을 얻지 만 모든 chunck를 연결하려고하면 Crapy 응답 (바이너리 직렬화 된 데이터처럼 보임)이 표시됩니다.
IOutputCacheEntry cacheEntry = cachedItem.Item as IOutputCacheEntry;
StringBuilder textResponse = new StringBuilder();
foreach (var responseRaw in cacheEntry.ResponseElements.Where(s=>!(s is FileResponseElement)))
{
Byte[] bytes = (Byte[])responseRaw.GetType().GetField("_buffer",
BindingFlags.NonPublic |
BindingFlags.Instance).GetValue(responseRaw);
textResponse.Append(Encoding.Default.GetString(bytes));
}
편집 : 어떻게가 someting처럼 할 수있는 나는 "캐릭터 라인 화"그 전에 모든 바이트 []를 CONCAT하려고, 난 UTF-8 인코딩을 시도했다.
UTF-8도 시도했습니다. –
나는 content-type 헤더로 시도 할 것입니다. –