用有道翻译将BlogEngine的博客文章标题转换为英文

#region using

using System;
using System.Web;
using System.Web.UI;
using BlogEngine.Core.Web.Controls;
using BlogEngine.Core;
using System.Text.RegularExpressions;
using System.Collections.Generic;
using System.Net;
using LSW.Api.YouDao;

#endregion

/// <summary>
/// Transliterate post Chinese slug into English
/// </summary>
[Extension("使用 有道 Api 将标题自动翻译并转换为英文别名", "1.0", "<a href=\"http://blog.lishewen.com\">算神</a>")]
public class YouDaoSlugTransliterator
{
    /// <summary>
    /// Hooks up an event handler to the Post.Serving event.
    /// </summary>
    static YouDaoSlugTransliterator()
    {
        Post.Saving += new EventHandler<SavedEventArgs>(Post_Saving);
    }

    /// <summary>
    /// Handles the Post.Saving event.
    /// </summary>
    private static void Post_Saving(object sender, SavedEventArgs e)
    {
        Post post = (Post)sender;
        if (post.New)
        {
            try
            {
                Translation t = new Translation();
                string translatedText = t.Translate(post.Title);

                //if (responseStatus == "200")
                //{
                    string slug = Utils.RemoveIllegalCharacters(translatedText);
                    if (slug.Length > 30)
                        slug.Substring(0, 30);

                    post.Slug = slug.ToLower();
                //}
            }
            catch
            {
                // We maybe need to catch some exception
            }
        }
    }
}

案例:Word文档另存为图片输出

最近收到客户的需求,他需要把Word文档的内容输出成图片,于是开发了这样一个插件

算神Word文档另存为图片插件是一个Office插件,可以将当前打开的Word文档保存为jpg图片格式

QQ截图20110721114557

有这方面开发需求的朋友可以联系我

WII Gecko金手指 To AR码 转换器 Beta2发布

http://geckotoarconverter.codeplex.com/releases/view/63185

主要修正:
1、首行有 0 结尾字符串的情况(http://blog.lishewen.co.cc/?p=137408#comment-130408)
2、增加首地址自定义输入(PS:同时使用时,首地址最好不要为80003200的4的累加,即80003204这种,会和前面冲突的,就是说AR CODE 最多可以同时使用4条)

由于本人硬盘有限不能对所有游戏进行测试,目前主玩SD高达WARS,欢迎更多人加入到测试行列