我建议你应该尽量确保你能成功 发送/接收任意二进制数据,以确定是否是'b 问题,或者是否是'gzipping'问题。 - Jon Skeet - < sk *** @ pobox.com> http://www.pobox.com/~skeet 博客: http://www.msmvps.com/jon.skeet 如果回复小组,请不要给我发邮件 I am using the .NET socket class to program a web client. When I comeupon gzip encoded conent, I am having trouble getting the decoded text.I have found the ICSharpCode.SharpZipLib to help, but in using theirsample code, I keep encountering an error message about the first bytenot matching. Clearly it is expecting a certain byte value as thefirst byte, which leads me to think that I need to split the encodedbody away from the unencoded header, and send only the encoded part tothe GZIPInputStream. While I know that division is determined by ablank line, when I split it over that line (whether I include thecarriage return in the encoded part or not) I still get the same error.Has anyone been able to use that library for decoding a webpage thathas a gzipped body?thanks! 解决方案I suggest you split the problem into two halves. You need to checkthat:1) You can zip something up and then unzip it2) You can transfer binary data without loss in a web requestI suspect your problem is in the second part, but you should be able towork on that entirely separately from the first part.--Jon Skeet - <sk***@pobox.com> http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeetIf replying to the group, please do not mail me tooI''m suggesting that you should try to make sure you can successfullytransmit/receive arbitrary binary data to work out whether that''s theproblem or whether it''s the gzipping that''s the problem.--Jon Skeet - <sk***@pobox.com> http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeetIf replying to the group, please do not mail me too 这篇关于ICSharpCode.SharpZipLib.GZip.GZipInputStream与HTTP请求一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 1403页,肝出来的..
09-06 13:33