本人忘记了是哪个开源组件了,只知道有以下代码的有类名为Multipartparser的,希望大家知道的话提供源码: IServiceProvider provider = (IServiceProvider) HttpContext.Current; 
  HttpWorkerRequest wr = (HttpWorkerRequest) provider.GetService(typeof(HttpWorkerRequest));
  byte[] bs = wr.GetPreloadedEntityBody();
  ….
  if (!wr.IsEntireEntityBodyIsPreloaded())
  {
        int n = 1024;
        byte[] bs2 = new byte[n];
        while (wr.ReadEntityBody(bs2,n) >0)
       {
             …..
        }
  }
Multipartparser.cs //修改构造函数,增加contentEncoding参数
public MultipartParser(Stream s, string boundary, int contentLength, System.Text.Encoding contentEncoding)//添加新函数,解决Header中的编码问题
protected string ReadHeaderLine(Stream s)
{
// TODO: chunk
const byte cr = (byte)’\r’;
const byte cn = (byte)’\n’;
byte[] tempValues = new byte[2048];
int ii=0;
byte current = (byte)s.ReadByte();
while (current != cr && current != cn)
{
ii++;
tempValues[ii-1]=current;
current = (byte)s.ReadByte();
}if (current == cr)
s.ReadByte();
byte[] newValues = new byte[ii];
Array.Copy(tempValues,newValues,(long)(ii));
return _contentEncoding.GetString(newValues);
} //将调用ReadLine的地方修改成ReadHeaderLine
protected NameValueCollection ReadHeaders()
{
NameValueCollection headers = new NameValueCollection();//string line = ReadLine(_s);
string line = ReadHeaderLine(_s);// TODO: Handle continuations – lines starting with whitespace
while (line.Length > 0)
{
int pos = line.IndexOf(‘:’);headers[line.Substring(0, pos)] = line.Substring(pos + 1);//line = ReadLine(_s);
line = ReadHeaderLine(_s);
}return headers;
}