急要url编码的vc解码程序 谁能提供一段代码么? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 另请问,网页将附件上传时附件编码是何种编码? base64? printed -quote ? 啊~~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;} 非常感谢,请告诉我在msdn中的位置,我一定给分。另外,哪位朋友知道通过网页发附件时的编码方式,比如发二进制文件时采用的办法!因为我手头没有另外的分,所以只好这样 oldnew(^_^) 朋友,请告诉我这段程序在msdn中的位置,谢谢! 尽管oldnew朋友没有回答,我还是将分结给你,非常感谢,如果啥时候看到了,请告诉我这段程序在msdn中的位置。 Bitmap::FromResource怎么用 郁闷,YUV2转RGB后图像颠倒? cwinapp cwnd 的区别 希望能帮助大家多多交流技术 用Activex Control Test Container测试Activx 控件,退出Activex Control Test Container后,再编译工程文件,出错,不能写入DLL。 如何在CEdit控件中显示多个字符串 高手请进----关于图像扫描处理 出现这样的报错是怎么回事??请指教!! 急!请给点帮助 ccombobox控件绑定的字符串变量长度有限制吗? 比较菜的一个问题,但强烈希望各位回答一下 医学图片与数据库
{
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;
}