谁能提供一段代码么?

解决方案 »

  1.   

    另请问,网页将附件上传时附件编码是何种编码? base64? printed -quote ?
      

  2.   

    啊~~msdn 的sample里就有啊,抄来给你CString Decode( const CString& str, BOOL bQuery )
    {
    int ndx;
    CString strDecoded = str;
    // special processing or query strings....
    if ( bQuery )
    {
    // change all '+' to ' '....
    while( (ndx=strDecoded.Find('+')) != -1 )
    strDecoded = strDecoded.Left(ndx) + ' ' + strDecoded.Mid(ndx+1);
    } // first see if there are any %s to decode....
    if ( strDecoded.Find( '%' ) != -1 )
    {
    // iterate through the string, changing %dd to special char....
    for( ndx=0; ndx < strDecoded.GetLength(); ndx++ )
    {
    char ch = strDecoded.GetAt( ndx );
    if ( ch == '%' )
    {
    if ( strDecoded.GetAt( ndx+1 ) == '%' )
    {
    // wanna keep one percent sign....
    strDecoded = strDecoded.Left(ndx) + strDecoded.Mid(ndx+1);
    }
    else
    {
    // assume we have a hex value....
    char ch1 = strDecoded.GetAt(ndx+1);
    char ch2 = strDecoded.GetAt(ndx+2);
    ch1 = ch1 >= 'A' ? (ch1&0xdf)-'A' : ch1-'0';
    ch2 = ch2 >= 'A' ? (ch2&0xdf)-'A' : ch2-'0';
    // replace the escape sequence with the char....
    strDecoded = strDecoded.Left(ndx)
    + (char)(ch1*16 + ch2)
    + strDecoded.Mid( ndx+3 );
    }
    }
    }
    }
    return strDecoded;
    }
      

  3.   

    非常感谢,请告诉我在msdn中的位置,我一定给分。另外,哪位朋友知道通过网页发附件时的编码方式,比如发二进制文件时采用的办法!因为我手头没有另外的分,所以只好这样
      

  4.   

    oldnew(^_^) 朋友,请告诉我这段程序在msdn中的位置,谢谢!
      

  5.   

    尽管oldnew朋友没有回答,我还是将分结给你,非常感谢,如果啥时候看到了,请告诉我这段程序在msdn中的位置。