宝玉

专注于web开发技术
随笔 - 114, 评论 - 1519 , 引用 - 583

又修正了asp.net forums的几个bug

 post.cs

GetBodySummary方法在中文环境下的一点小bug,可能会导致搜索页无法显示。

if (postBody.Length > size) {
 int whitespace = 0;
 // Clip the body
 postBody = postBody.Substring(0, size);

 // Find the last occurence of a space
 // 因为英文怕截断字符单词不完整,所以寻找最后一个空格位置,但是有可能整个帖子没空格,那就会出错!
 whitespace = postBody.LastIndexOf(" ");

 // Rebuild postBody string
 postBody = postBody.Substring(0, whitespace) + " ...";
    }

修改成

    if (postBody.Length > size) {
 // Rebuild postBody string
 // 直接这样就好了,中文不用担心单词会被截断
 postBody = postBody.Substring(0, size) + " ...";
    }

-----------------------------

头像上传很不清晰!

这是因为默认图片保存格式是ImageFormat.Gif 如果是jpg的图像就会失真

在Resources.cs中的ResizeImage (Stream stream, int height, int width, ImageFormat format)方法
增加两行
if (bitmapOriginal.RawFormat != format)
    format = ImageFormat.Jpeg;

bitmapResize.Save(returnStream, format);

或者你可以直接改成bitmapResize.Save(returnStream, bitmapOriginal.RawFormat );

发表于 2004年5月12日 19:08

评论

# re: 又修正了asp.net forums的几个bug

谢谢提示,bug不少,我们一个个地改。
2004-6-1 18:15 | Dili

Post Comment

主题  
姓名  
主页
校验码  
内容   
京ICP备 05050892号